[FFmpeg-devel] [PATCH 5/8] Avoid assignment inside if.

Diego 'Flameeyes' Pettenò flameeyes
Thu Oct 2 16:39:29 CEST 2008


The Intel C compiler warns on this assignment during if, probably
because it's being assigned as a constant. To aoid a spurious warning,
split it into two instructions, which should also make it more logical
once the FIXME is resolved.
---

 libavcodec/wmaenc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index 4558947..195c270 100644
--- a/libavcodec/wmaenc.c
+++ b/libavcodec/wmaenc.c
@@ -178,7 +178,8 @@ static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
     }
 
     for(ch = 0; ch < s->nb_channels; ch++) {
-        if ((s->channel_coded[ch]= 1)) { //FIXME only set channel_coded when needed, instead of always
+        s->channel_coded[ch] = 1; //FIXME only set channel_coded when needed, instead of always
+        if (s->channel_coded[ch]) {
             init_exp(s, ch, fixed_exp);
         }
     }





More information about the ffmpeg-devel mailing list