[FFmpeg-devel] [PATCH] H264 parser fix

Howard Chu hyc
Fri May 28 21:53:48 CEST 2010

Michael Niedermayer wrote:
> On Thu, May 27, 2010 at 09:29:52PM -0700, Howard Chu wrote:
>> Michael Niedermayer wrote:
>>> On Tue, May 25, 2010 at 08:49:13PM -0700, Howard Chu wrote:
>>>> OK. Added an explicit flag to the H264Context for this instead. Still
>>>> this
>>>> feels clumsy, it should have just been done in the parser_init step. Also
>>>> it feels clumsy that it has to be parsed again, when the H264Context
>>>> hanging off the AVCodecContext may already have it (due to
>>>> ff_h264_decode_init() having parsed it already).
>>>> There was a suggestion on IRC to add an av_parser_init2() API which
>>>> provides the AVCodecContext, to be given to a new H264 parser_init2
>>>> function. It could just fallback to passing the codec_id if a given
>>>> parser
>>>> doesn't implement the init2 function...
>>> if that works iam nt against it but it will require apps to be updated for
>>> some files. not a big issue as far as iam concerned
>> I decided it was too much trouble to add a new API for this. I also noticed
>> that mpeg4video_parser is already doing the same thing as the patch I
>> posted, so I'm going to stick with that approach. Added a "first_picture"
>> flag, which is used the same way as the flag in ParseContext1 used by
>> mpeg4video_parser.
>> I didn't add the flag to the end of the structure, didn't think it was
>> necessary since H264Context is totally private.

>> @@ -319,6 +327,7 @@
>>   {
>>       H264Context *h = s->priv_data;
>>       h->thread_context[0] = h;
>> +    h->first_picture = 1;
> a variable that starts with 0 wouldnt need this

Sorry, I jumped the gun and committed already since it was doing the same as 
existing (mpeg4video_parser) code. How's this for a cleanup...

   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dif.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100528/b701c2c4/attachment.txt>

More information about the ffmpeg-devel mailing list