[FFmpeg-devel] [PATCH] avcodec/videotoolbox: fix -Wunused-but-set-variable

Ganesh Ajjanagadde gajjanag at mit.edu
Sat Sep 19 23:42:06 CEST 2015


On Sat, Sep 19, 2015 at 5:33 PM, Hendrik Leppkes <h.leppkes at gmail.com> wrote:
> On Sat, Sep 19, 2015 at 9:58 PM, Ganesh Ajjanagadde
> <gajjanagadde at gmail.com> wrote:
>> pix_fmt was declared presumably to shorten the argument passed to the function.
>> However, it is currently not being used for such a purpose.
>> This patch makes it used for that purpose.
>> This fixes -Wunused-but-set-variable reported at e.g:
>> http://fate.ffmpeg.org/log.cgi?time=20150919194249&log=compile&slot=x86_64-darwin-gcc-4.9.
>>
>> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
>> ---
>>  libavcodec/videotoolbox.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
>> index b78238a..e35eb2d 100644
>> --- a/libavcodec/videotoolbox.c
>> +++ b/libavcodec/videotoolbox.c
>> @@ -546,7 +546,7 @@ static int videotoolbox_default_init(AVCodecContext *avctx)
>>
>>      buf_attr = videotoolbox_buffer_attributes_create(avctx->width,
>>                                                       avctx->height,
>> -                                                     videotoolbox->cv_pix_fmt_type);
>> +                                                     pix_fmt);
>>
>>      decoder_cb.decompressionOutputCallback = videotoolbox_decoder_callback;
>>      decoder_cb.decompressionOutputRefCon   = avctx;
>
> If the variable is entirely unused right now, then it should just be
> removed instead of finding some  use for it that'll just get optimized
> away anyway.

ok; patchv2 created.

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list