diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-21 12:37:59 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-30 23:35:37 +0100 |
commit | 06336ce760257ae2dbe350cd568a3eb45f48147f (patch) | |
tree | a17107309641de4d307e1b8d671c1faa1ef69aaf | |
parent | 6f580e87350c817ac3176a9e75d158bf3faad4e3 (diff) | |
download | ffmpeg-06336ce760257ae2dbe350cd568a3eb45f48147f.tar.gz |
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>
-rw-r--r-- | libavformat/avformat.h | 2 | ||||
-rw-r--r-- | libavformat/utils.c | 12 | ||||
-rw-r--r-- | tests/ref/fate/cdxl-bitline-ham6 | 2 | ||||
-rw-r--r-- | tests/ref/fate/cdxl-ham8 | 2 | ||||
-rw-r--r-- | tests/ref/fate/cdxl-pal8 | 2 | ||||
-rw-r--r-- | tests/ref/fate/vcr2 | 2 |
6 files changed, 14 insertions, 8 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index b915148ad7..ebf04f6393 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -916,7 +916,7 @@ typedef struct AVStream { /** * Stream information used internally by av_find_stream_info() */ -#define MAX_STD_TIMEBASES (60*12+6) +#define MAX_STD_TIMEBASES (30*12+7+6) struct { int64_t last_dts; int64_t duration_gcd; diff --git a/libavformat/utils.c b/libavformat/utils.c index e899e4d071..d9ffaed0b9 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2743,10 +2743,16 @@ static void compute_chapters_end(AVFormatContext *s) static int get_std_framerate(int i) { - if (i < 60 * 12) + if (i < 30*12) return (i + 1) * 1001; - else - return ((const int[]) { 24, 30, 60, 12, 15, 48 })[i - 60 * 12] * 1000 * 12; + i -= 30*12; + + if (i < 7) + return ((const int[]) { 40, 48, 50, 60, 80, 120, 240})[i] * 1001 * 12; + + i -= 7; + + return ((const int[]) { 24, 30, 60, 12, 15, 48 })[i] * 1000 * 12; } /* Is the time base unreliable? diff --git a/tests/ref/fate/cdxl-bitline-ham6 b/tests/ref/fate/cdxl-bitline-ham6 index 8060f06024..9ba7404b71 100644 --- a/tests/ref/fate/cdxl-bitline-ham6 +++ b/tests/ref/fate/cdxl-bitline-ham6 @@ -1,4 +1,4 @@ -#tb 0: 12/601 +#tb 0: 1/50 0, 0, 0, 1, 63180, 0xcda82c16 0, 1, 1, 1, 63180, 0xa6097bf9 0, 2, 2, 1, 63180, 0x4c2fb091 diff --git a/tests/ref/fate/cdxl-ham8 b/tests/ref/fate/cdxl-ham8 index 269f1f30cf..1eebea37c7 100644 --- a/tests/ref/fate/cdxl-ham8 +++ b/tests/ref/fate/cdxl-ham8 @@ -1,2 +1,2 @@ -#tb 0: 3/158 +#tb 0: 12/281 0, 0, 0, 1, 67584, 0xce0cade5 diff --git a/tests/ref/fate/cdxl-pal8 b/tests/ref/fate/cdxl-pal8 index 82d4d634c7..b2fb04518e 100644 --- a/tests/ref/fate/cdxl-pal8 +++ b/tests/ref/fate/cdxl-pal8 @@ -1,4 +1,4 @@ -#tb 0: 12/601 +#tb 0: 1/50 0, 0, 0, 1, 67584, 0x5eae629b 0, 1, 1, 1, 67584, 0x32591227 0, 2, 2, 1, 67584, 0x4e4424c7 diff --git a/tests/ref/fate/vcr2 b/tests/ref/fate/vcr2 index 521e55fd04..f7e1540b33 100644 --- a/tests/ref/fate/vcr2 +++ b/tests/ref/fate/vcr2 @@ -1,4 +1,4 @@ -#tb 0: 16701/250000 +#tb 0: 1001/15000 0, 0, 0, 1, 38016, 0x50e93e0d 0, 1, 1, 1, 38016, 0x6ac8627d 0, 2, 2, 1, 38016, 0x6f38661e |