[FFmpeg-cvslog] flvenc: silence bogus warning

Benjamin Larsson git at videolan.org
Tue Sep 18 15:24:44 CEST 2012


ffmpeg | branch: master | Benjamin Larsson <benjamin at southpole.se> | Mon Sep 17 21:14:58 2012 +0200| [6a08955c104450dfc8f56aa9f552a4c08f8d8f7f] | committer: Luca Barbato

flvenc: silence bogus warning

The compiler fails to figure out that enc->codec_type can only
have 3 different values.
Thus when an if/else is encountered it triggers on the possibility
of the else case has not initialized the flags variable.

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6a08955c104450dfc8f56aa9f552a4c08f8d8f7f
---

 libavformat/flvenc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 57e7aac..839b9b0 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -421,7 +421,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
     unsigned ts;
     int size = pkt->size;
     uint8_t *data = NULL;
-    int flags, flags_size;
+    int flags = 0, flags_size;
 
     // av_log(s, AV_LOG_DEBUG, "type:%d pts: %"PRId64" size:%d\n",
     //        enc->codec_type, timestamp, size);



More information about the ffmpeg-cvslog mailing list