[FFmpeg-devel] [PATCH] mpeg4videodec: Fix unused variable warning

Mark Thompson sw at jkqxz.net
Thu Dec 21 21:54:56 EET 2017


video_format is not used.
---
Introduced by 4b2a186ef02c1fbe7f7cae30a2bdfff72bcc75f7:

src/libavcodec/mpeg4videodec.c: In function ‘mpeg4_decode_visual_object’:
src/libavcodec/mpeg4videodec.c:1771:17: warning: unused variable ‘video_format’ [-Wunused-variable]
             int video_format = get_bits(gb, 3);
                 ^~~~~~~~~~~~

 libavcodec/mpeg4videodec.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index e9cba25dd0..12755b5e8a 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -1768,9 +1768,10 @@ static int mpeg4_decode_visual_object(MpegEncContext *s, GetBitContext *gb)
         visual_object_type == VOT_STILL_TEXTURE_ID) {
         int video_signal_type = get_bits1(gb);
         if (video_signal_type) {
-            int video_format = get_bits(gb, 3);
-            int video_range = get_bits1(gb);
-            int color_description = get_bits1(gb);
+            int video_range, color_description;
+            skip_bits(gb, 3); // video_format
+            video_range = get_bits1(gb);
+            color_description = get_bits1(gb);
 
             s->avctx->color_range = video_range ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
 
-- 
2.11.0


More information about the ffmpeg-devel mailing list