[FFmpeg-devel] [PATCH]lavc/vaap_hevc: Do not initialize fields twice

Carl Eugen Hoyos ceffmpeg at gmail.com
Thu Mar 28 01:52:41 EET 2019


2019-03-27 23:10 GMT+01:00, Mark Thompson <sw at jkqxz.net>:
> On 27/03/2019 13:58, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch fixes a warning when compiling vaapi with clang.
>>
>> From 6463a3cf5730be9e9e6003f4aaf6c9fab7f68407 Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos <ceffmpeg at gmail.com>
>> Date: Wed, 27 Mar 2019 14:52:35 +0100
>> Subject: [PATCH] lavc/vaapi_hevc: Do not initialize fields twice.
>>
>> Fixes the following compilation warnings:
>> libavcodec/vaapi_hevc.c:155:21: warning: initializer overrides prior
>> initialization of this subobject [-Winitializer-overrides]
>>         .pic_fields.bits = {
>>                    ~^~~~
>> libavcodec/vaapi_hevc.c:125:57: note: previous initialization is here
>>         .pic_fields.value                             = 0,
>>                                                         ^
>> libavcodec/vaapi_hevc.c:175:31: warning: initializer overrides prior
>> initialization of this subobject [-Winitializer-overrides]
>>         .slice_parsing_fields.bits = {
>>                              ~^~~~
>> libavcodec/vaapi_hevc.c:126:57: note: previous initialization is here
>>         .slice_parsing_fields.value                   = 0,
>> ---
>>  libavcodec/vaapi_hevc.c |    2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
>> index 19aabcd..c69d63d 100644
>> --- a/libavcodec/vaapi_hevc.c
>> +++ b/libavcodec/vaapi_hevc.c
>> @@ -122,8 +122,6 @@ static int vaapi_hevc_start_frame(AVCodecContext
>>    *avctx,
>>      pic->pic.output_surface = ff_vaapi_get_surface_id(h->ref->frame);
>>
>>      pic->pic_param = (VAPictureParameterBufferHEVC) {
>> -        .pic_fields.value                             = 0,
>> -        .slice_parsing_fields.value                   = 0,
>>          .pic_width_in_luma_samples                    = sps->width,
>>          .pic_height_in_luma_samples                   = sps->height,
>>          .log2_min_luma_coding_block_size_minus3       =
>> sps->log2_min_cb_size - 3,
>> --
>> 1.7.10.4
>
> LGTM.

Patch applied.

Thank you, Carl Eugen


More information about the ffmpeg-devel mailing list