aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mxfdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-16 22:41:41 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-16 22:44:32 +0100
commit93e3ec451caf12ebb22fbf3ecdb7bba41f7835c6 (patch)
tree59f9dbe216cc6860b8556a3a6b615a131d1e44e7 /libavformat/mxfdec.c
parent76c48a78d1c0842d26b8ae926af3610935b0f280 (diff)
parent9925f7df0a50387ade8d83cb85b40c53e41e7041 (diff)
downloadffmpeg-93e3ec451caf12ebb22fbf3ecdb7bba41f7835c6.tar.gz
Merge commit '9925f7df0a50387ade8d83cb85b40c53e41e7041' into release/0.10
* commit '9925f7df0a50387ade8d83cb85b40c53e41e7041': vc1dec: Make sure last_picture is initialized in vc1_decode_skip_blocks r3d: Add more input value validation fraps: Make the input buffer size checks more strict svq3: Avoid a division by zero rmdec: Validate the fps value twinvqdec: Check the ibps parameter separately asfdec: Check the return value of asf_read_stream_properties mxfdec: set audio timebase to 1/samplerate pcx: Check the packet size before assuming it fits a palette rpza: Fix a buffer size check xxan: Disallow odd width xan: Only read within the data that actually was initialized Conflicts: libavcodec/fraps.c libavformat/mxfdec.c tests/ref/seek/lavf_mxf tests/ref/seek/lavf_mxf_d10 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mxfdec.c')
-rw-r--r--libavformat/mxfdec.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index f63cff9be8..b7bb4dff19 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1397,8 +1397,17 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
st->codec->codec_id = container_ul->id;
st->codec->channels = descriptor->channels;
st->codec->bits_per_coded_sample = descriptor->bits_per_sample;
- if (descriptor->sample_rate.den > 0)
- st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den;
+ if (descriptor->sample_rate.den > 0) {
+ st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den;
+ avpriv_set_pts_info(st, 64, descriptor->sample_rate.den, descriptor->sample_rate.num);
+ } else {
+ av_log(mxf->fc, AV_LOG_WARNING, "invalid sample rate (%d/%d) "
+ "found for stream #%d, time base forced to 1/48000\n",
+ descriptor->sample_rate.num, descriptor->sample_rate.den,
+ st->index);
+ avpriv_set_pts_info(st, 64, 1, 48000);
+ }
+
/* TODO: implement CODEC_ID_RAWAUDIO */
if (st->codec->codec_id == CODEC_ID_PCM_S16LE) {
if (descriptor->bits_per_sample > 16 && descriptor->bits_per_sample <= 24)