Browse code

avformat: replace some odd 30-60 rates by higher less odd ones in get_std_framerate()

Fixes Ticket4012

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 367c9d33d6dd1e8a85b63e14464e7e08ee1315cc)

Conflicts:

libavformat/version.h

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2014/11/21 20:37:59
Showing 6 changed files
... ...
@@ -916,7 +916,7 @@ typedef struct AVStream {
916 916
     /**
917 917
      * Stream information used internally by av_find_stream_info()
918 918
      */
919
-#define MAX_STD_TIMEBASES (60*12+6)
919
+#define MAX_STD_TIMEBASES (30*12+7+6)
920 920
     struct {
921 921
         int64_t last_dts;
922 922
         int64_t duration_gcd;
... ...
@@ -2743,10 +2743,16 @@ static void compute_chapters_end(AVFormatContext *s)
2743 2743
 
2744 2744
 static int get_std_framerate(int i)
2745 2745
 {
2746
-    if (i < 60 * 12)
2746
+    if (i < 30*12)
2747 2747
         return (i + 1) * 1001;
2748
-    else
2749
-        return ((const int[]) { 24, 30, 60, 12, 15, 48 })[i - 60 * 12] * 1000 * 12;
2748
+    i -= 30*12;
2749
+
2750
+    if (i < 7)
2751
+        return ((const int[]) { 40, 48, 50, 60, 80, 120, 240})[i] * 1001 * 12;
2752
+
2753
+    i -= 7;
2754
+
2755
+    return ((const int[]) { 24, 30, 60, 12, 15, 48 })[i] * 1000 * 12;
2750 2756
 }
2751 2757
 
2752 2758
 /* Is the time base unreliable?
... ...
@@ -1,4 +1,4 @@
1
-#tb 0: 12/601
1
+#tb 0: 1/50
2 2
 0,          0,          0,        1,    63180, 0xcda82c16
3 3
 0,          1,          1,        1,    63180, 0xa6097bf9
4 4
 0,          2,          2,        1,    63180, 0x4c2fb091
... ...
@@ -1,2 +1,2 @@
1
-#tb 0: 3/158
1
+#tb 0: 12/281
2 2
 0,          0,          0,        1,    67584, 0xce0cade5
... ...
@@ -1,4 +1,4 @@
1
-#tb 0: 12/601
1
+#tb 0: 1/50
2 2
 0,          0,          0,        1,    67584, 0x5eae629b
3 3
 0,          1,          1,        1,    67584, 0x32591227
4 4
 0,          2,          2,        1,    67584, 0x4e4424c7
... ...
@@ -1,4 +1,4 @@
1
-#tb 0: 16701/250000
1
+#tb 0: 1001/15000
2 2
 0,          0,          0,        1,    38016, 0x50e93e0d
3 3
 0,          1,          1,        1,    38016, 0x6ac8627d
4 4
 0,          2,          2,        1,    38016, 0x6f38661e