[FFmpeg-devel] [PATCH] H264 parser fix

Michael Niedermayer michaelni
Fri May 28 21:59:14 CEST 2010

On Fri, May 28, 2010 at 12:53:48PM -0700, Howard Chu wrote:
> 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...


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100528/3541fe93/attachment.pgp>

More information about the ffmpeg-devel mailing list