[FFmpeg-devel] [PATCH] Two problems with MPEG2 decoder

Joseph Artsimovich joseph at mirriad.com
Fri Mar 1 15:22:44 CET 2013

On 26/02/13 20:42, Michael Niedermayer wrote:
 > ...
 > you can try: (if it works it could be tried to limit it to the kind
 > of videos that actually need it)
 > diff --git a/libavformat/mov.c b/libavformat/mov.c
 > index 137f79b..4a51581 100644
 > --- a/libavformat/mov.c
 > +++ b/libavformat/mov.c
 > @@ -1562,6 +1562,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, 
AVIOContext *pb, int entries)
 >           st->need_parsing = AVSTREAM_PARSE_FULL;
 >           break;
 >       case AV_CODEC_ID_MPEG1VIDEO:
 > +    case AV_CODEC_ID_MPEG2VIDEO:
 >           st->need_parsing = AVSTREAM_PARSE_FULL;
 >           break;
 >       case AV_CODEC_ID_VC1:

That didn't help.

However, my case turned out to be an easy one to handle. The stream in 
question does have picture coding extensions that correctly indicate 
picture_structure == FRAME_PICT for problematic frames. Knowing that, 
it's easy to discard any extra picture headers that may follow the frame 

The patch is attached and it does pass FATE.

Joseph Artsimovich
Senior C++ Applications Developer
MirriAd Ltd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Handle-an-invalid-extra-mpeg2-picture-header-followi.patch
Type: text/x-diff
Size: 1479 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130301/5cc26c41/attachment.bin>

More information about the ffmpeg-devel mailing list