[FFmpeg-devel] [PATCH] libavfilter: add a default to silence a warning
Stefano Sabatini
stefano.sabatini-lala at poste.it
Tue Jul 5 01:57:58 CEST 2011
On date Monday 2011-07-04 20:46:15 +0200, Nicolas George encoded:
> The attached patch adds a default case to the inline function
> avfilter_copy_buffer_ref_props, to silence this:
>
> ffmpeg/libavfilter/avfilter.h: In function 'avfilter_copy_buffer_ref_props':
> ffmpeg/libavfilter/avfilter.h:159:5: warning: enumeration value 'AVMEDIA_TYPE_UNKNOWN' not handled in switch [-Wswitch]
> ffmpeg/libavfilter/avfilter.h:159:5: warning: enumeration value 'AVMEDIA_TYPE_DATA' not handled in switch [-Wswitch]
> ffmpeg/libavfilter/avfilter.h:159:5: warning: enumeration value 'AVMEDIA_TYPE_SUBTITLE' not handled in switch [-Wswitch]
> ffmpeg/libavfilter/avfilter.h:159:5: warning: enumeration value 'AVMEDIA_TYPE_ATTACHMENT' not handled in switch [-Wswitch]
> ffmpeg/libavfilter/avfilter.h:159:5: warning: enumeration value 'AVMEDIA_TYPE_NB' not handled in switch [-Wswitch]
>
> ... that has annoyed me all afternoon.
>
> Regards,
>
> --
> Nicolas George
> From 645edf08a6190eb633b69946ad61d85546db92b1 Mon Sep 17 00:00:00 2001
> From: Nicolas George <nicolas.george at normalesup.org>
> Date: Mon, 4 Jul 2011 20:43:37 +0200
> Subject: [PATCH] libavfilter: add a default to silence a warning.
>
>
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
> libavfilter/avfilter.h | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> index 704b77d..226d7be 100644
> --- a/libavfilter/avfilter.h
> +++ b/libavfilter/avfilter.h
> @@ -162,6 +162,7 @@ static inline void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilt
> switch (src->type) {
> case AVMEDIA_TYPE_VIDEO: *dst->video = *src->video; break;
> case AVMEDIA_TYPE_AUDIO: *dst->audio = *src->audio; break;
> + default: break;
> }
> }
OK of course, and IMO no need for patches for such trivial changes.
(but note that I never had those warnings, maybe it depends on the fact
that I usually disable optims...).
--
FFmpeg = Frenzy Friendly Mystic Powerful Ecumenical Geek
More information about the ffmpeg-devel
mailing list