[FFmpeg-devel] [PATCH] h264.c: add HW acceleration hooks (take 2)

Gwenole Beauchesne gbeauchesne
Fri Feb 27 13:46:26 CET 2009


On Fri, 27 Feb 2009, Benoit Fouet wrote:

>> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
>> index 24dc201..160edb0 100644
>> --- a/libavcodec/h264.c
>> +++ b/libavcodec/h264.c
>> @@ -7490,6 +7490,11 @@ static int decode_nal_units(H264Context *h, const
>> uint8_t *buf, int buf_size){
>>              if((err = decode_slice_header(hx, h)))
>>                 break;
>>
>> +            if (s->avctx->hwaccel && h->current_slice == 1) {
>> +                if (s->avctx->hwaccel->start_frame(s->avctx, NULL, 0) < 0)
>> +                    return -1;
>> +            }
>> +
>>
>
> the if()'s can be merged (not sure this is important though)

Actually, I will probably only move the h->current_slice == 1 beneath 
instead. I'd like to keep the if (s->avctx->hwaccel) { ... } structure as 
is so that it could be converted to an if (CONFIG_HWACCEL && 
s->avctx->hwaccel) {}?afterwards.

Don't know what Michael think about it though.

Besides, multiline if()'s generally look weird to me. ;-)



More information about the ffmpeg-devel mailing list