diff mbox series

[FFmpeg-devel,2/2] avdevice/dshow: silence warnings about unused variable

Message ID 20220413161515.6999-2-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/2] avdevice/dshow: remove unused variables | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

James Almer April 13, 2022, 4:15 p.m. UTC
Use av_unused instead of wrapping the declaration under the DSHOWDEBUG check
in case future changes make use of it.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavdevice/dshow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Roger Pack April 19, 2022, 6:05 a.m. UTC | #1
On Wed, Apr 13, 2022 at 10:15 AM James Almer <jamrial@gmail.com> wrote:
>
> Use av_unused instead of wrapping the declaration under the DSHOWDEBUG check
> in case future changes make use of it.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavdevice/dshow.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
> index ac8b64366f..6277a27453 100644
> --- a/libavdevice/dshow.c
> +++ b/libavdevice/dshow.c
> @@ -976,7 +976,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
>              }
>          } else {
>              WAVEFORMATEX *fx;
> -            AUDIO_STREAM_CONFIG_CAPS *acaps = caps;
> +            AUDIO_STREAM_CONFIG_CAPS av_unused *acaps = caps;
>  #if DSHOWDEBUG
>              ff_print_AUDIO_STREAM_CONFIG_CAPS(acaps);
>  #endif

Or maybe put it within the #if ? Just an idea.
James Almer April 19, 2022, 11:19 a.m. UTC | #2
On 4/19/2022 3:05 AM, Roger Pack wrote:
> On Wed, Apr 13, 2022 at 10:15 AM James Almer <jamrial@gmail.com> wrote:
>>
>> Use av_unused instead of wrapping the declaration under the DSHOWDEBUG check
>> in case future changes make use of it.
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>   libavdevice/dshow.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
>> index ac8b64366f..6277a27453 100644
>> --- a/libavdevice/dshow.c
>> +++ b/libavdevice/dshow.c
>> @@ -976,7 +976,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
>>               }
>>           } else {
>>               WAVEFORMATEX *fx;
>> -            AUDIO_STREAM_CONFIG_CAPS *acaps = caps;
>> +            AUDIO_STREAM_CONFIG_CAPS av_unused *acaps = caps;
>>   #if DSHOWDEBUG
>>               ff_print_AUDIO_STREAM_CONFIG_CAPS(acaps);
>>   #endif
> 
> Or maybe put it within the #if ? Just an idea.

I mentioned as much in the commit message, but figured it would be nicer 
to not do it in case it's needed later. But ok, will go that route instead.

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index ac8b64366f..6277a27453 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -976,7 +976,7 @@  dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
             }
         } else {
             WAVEFORMATEX *fx;
-            AUDIO_STREAM_CONFIG_CAPS *acaps = caps;
+            AUDIO_STREAM_CONFIG_CAPS av_unused *acaps = caps;
 #if DSHOWDEBUG
             ff_print_AUDIO_STREAM_CONFIG_CAPS(acaps);
 #endif