diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-19 00:08:28 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-19 00:08:28 +0400 |
commit | e366e6bfab5c13970be2855d1031cb32aafa649e (patch) | |
tree | 653d562af5604539fcca7a3b34d09188c1759e0b /libavformat/matroskadec.c | |
parent | a02f8ef1d2f4cd267224c9bc3b5e841d7fc943cc (diff) | |
parent | 0f53601ac6b88196e2cae07a4c3aad6810413261 (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
ppc: drop unused function dct_quantize_altivec()
mpegaudiodec: Do not discard mp_decode_frame() return value.
matroska: do not set invalid default duration if frame rate is zero
mkv: use av_reduce instead of av_d2q for framerate estimation
mkv: report average framerate as minimal as well
avcodec_string: Favor AVCodecContext.codec over the default codec.
cook: Make constants passed to AV_BE2NE32C() unsigned to avoid signed overflow.
Conflicts:
libavcodec/cook.c
libavcodec/ppc/mpegvideo_altivec.c
libavcodec/utils.c
libavformat/matroskadec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r-- | libavformat/matroskadec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 6d2d43e738..41427fe5eb 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1448,7 +1448,7 @@ static int matroska_read_header(AVFormatContext *s) continue; if (track->type == MATROSKA_TRACK_TYPE_VIDEO) { - if (!track->default_duration) + if (!track->default_duration && track->video.frame_rate > 0) track->default_duration = 1000000000/track->video.frame_rate; if (!track->video.display_width) track->video.display_width = track->video.pixel_width; @@ -1661,8 +1661,11 @@ static int matroska_read_header(AVFormatContext *s) st->codec-> width * track->video.display_height, 255); st->need_parsing = AVSTREAM_PARSE_HEADERS; - if (track->default_duration) - st->avg_frame_rate = av_d2q(1000000000.0/track->default_duration, INT_MAX); + if (track->default_duration) { + av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, + 1000000000, track->default_duration, 30000); + st->avg_frame_rate = st->r_frame_rate; + } /* export stereo mode flag as metadata tag */ if (track->video.stereo_mode && track->video.stereo_mode < MATROSKA_VIDEO_STEREO_MODE_COUNT) |