diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-26 18:55:44 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-26 18:56:32 +0100 |
commit | 997a36238ff0c700acfb77decaa560dc7b3095ec (patch) | |
tree | 5790fa9c07524eec764daf9cb18cb3029dc838b4 | |
parent | e4eedb983dbc8c91441fae4619510271b5f1e914 (diff) | |
download | ffmpeg-997a36238ff0c700acfb77decaa560dc7b3095ec.tar.gz |
mpeg12: Detect MXF essence stuff at the end of frames
Fixes some of the issues with segment.mov
See: 0226 15:16 Joseph Artsimov (2.1K) [FFmpeg-devel] Two problems with MPEG2 decoder
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mpeg12.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 2ef33602f9..5e95ad7c4c 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -1821,6 +1821,15 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, && s->intra_dc_precision == 2 && s->q_scale_type == 1 && s->alternate_scan == 0 && s->progressive_frame == 0 /* vbv_delay == 0xBBB || 0xE10*/; + if (left >= 32 && !is_d10) { + GetBitContext gb = s->gb; + align_get_bits(&gb); + if (show_bits(&gb, 24) == 0x060E2B) { + av_log(avctx, AV_LOG_DEBUG, "Invalid MXF data found in video stream\n"); + is_d10 = 1; + } + } + if (left < 0 || (left && show_bits(&s->gb, FFMIN(left, 23)) && !is_d10) || ((avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_AGGRESSIVE)) && left > 8)) { av_log(avctx, AV_LOG_ERROR, "end mismatch left=%d %0X\n", left, show_bits(&s->gb, FFMIN(left, 23))); |