summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-21 12:37:59 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-21 13:56:13 +0100
commit367c9d33d6dd1e8a85b63e14464e7e08ee1315cc (patch)
tree0cdace2b3b3ec2725b9b1bec9a669ad58dab24a2 /libavformat
parentf0ae0354d3f04c369257c2a28557524d28c5df15 (diff)
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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avformat.h2
-rw-r--r--libavformat/utils.c12
-rw-r--r--libavformat/version.h2
3 files changed, 11 insertions, 5 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 7b5de4fee0..3d99f37476 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 6278668119..693b0339cf 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2787,10 +2787,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/libavformat/version.h b/libavformat/version.h
index a9e0ac2617..8f14d197b0 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
#define LIBAVFORMAT_VERSION_MAJOR 56
#define LIBAVFORMAT_VERSION_MINOR 14
-#define LIBAVFORMAT_VERSION_MICRO 100
+#define LIBAVFORMAT_VERSION_MICRO 101
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \