[FFmpeg-devel] [PATCH] Fix various if parenthesis misplacements.

Clément Bœsch ubitux at gmail.com
Mon Nov 21 07:52:02 CET 2011


---
 doc/examples/filtering.c  |    2 +-
 libavcodec/alsdec.c       |    2 +-
 libavdevice/v4l2.c        |    4 ++--
 libavfilter/vf_drawtext.c |    2 +-
 libavfilter/vf_fifo.c     |    2 +-
 libavformat/wav.c         |    2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/examples/filtering.c b/doc/examples/filtering.c
index 3ed6aa3..06e5130 100644
--- a/doc/examples/filtering.c
+++ b/doc/examples/filtering.c
@@ -173,7 +173,7 @@ int main(int argc, char **argv)
     av_register_all();
     avfilter_register_all();
 
-    if ((ret = open_input_file(argv[1]) < 0))
+    if ((ret = open_input_file(argv[1])) < 0)
         goto end;
     if ((ret = init_filters(filter_descr)) < 0)
         goto end;
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index d105526..586a960 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1442,7 +1442,7 @@ static int decode_frame(AVCodecContext *avctx,
         ctx->cur_frame_length = sconf->frame_length;
 
     // decode the frame data
-    if ((invalid_frame = read_frame_data(ctx, ra_frame) < 0))
+    if ((invalid_frame = read_frame_data(ctx, ra_frame)) < 0)
         av_log(ctx->avctx, AV_LOG_WARNING,
                "Reading frame data failed. Skipping RA unit.\n");
 
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 08ee201..07d3cb4 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -634,11 +634,11 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
         res = AVERROR(EIO);
         goto out;
     }
-    if ((res = av_image_check_size(s->width, s->height, 0, s1) < 0))
+    if ((res = av_image_check_size(s->width, s->height, 0, s1)) < 0)
         goto out;
     s->frame_format = desired_format;
 
-    if ((res = v4l2_set_parameters(s1, ap) < 0))
+    if ((res = v4l2_set_parameters(s1, ap)) < 0)
         goto out;
 
     st->codec->pix_fmt = fmt_v4l2ff(desired_format, codec_id);
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 7d4476f..43d39c0 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -359,7 +359,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
     load_glyph(ctx, NULL, 0);
 
     /* set the tabsize in pixels */
-    if ((err = load_glyph(ctx, &glyph, ' ') < 0)) {
+    if ((err = load_glyph(ctx, &glyph, ' ')) < 0) {
         av_log(ctx, AV_LOG_ERROR, "Could not set tabsize.\n");
         return err;
     }
diff --git a/libavfilter/vf_fifo.c b/libavfilter/vf_fifo.c
index 46e9373..0601811 100644
--- a/libavfilter/vf_fifo.c
+++ b/libavfilter/vf_fifo.c
@@ -76,7 +76,7 @@ static int request_frame(AVFilterLink *outlink)
     int ret;
 
     if (!fifo->root.next) {
-        if ((ret = avfilter_request_frame(outlink->src->inputs[0]) < 0))
+        if ((ret = avfilter_request_frame(outlink->src->inputs[0])) < 0)
             return ret;
     }
 
diff --git a/libavformat/wav.c b/libavformat/wav.c
index 096f706..22914c9 100644
--- a/libavformat/wav.c
+++ b/libavformat/wav.c
@@ -442,7 +442,7 @@ static int wav_read_header(AVFormatContext *s,
         switch (tag) {
         case MKTAG('f', 'm', 't', ' '):
             /* only parse the first 'fmt ' tag found */
-            if (!got_fmt && (ret = wav_parse_fmt_tag(s, size, &st) < 0)) {
+            if (!got_fmt && (ret = wav_parse_fmt_tag(s, size, &st)) < 0) {
                 return ret;
             } else if (got_fmt)
                 av_log(s, AV_LOG_WARNING, "found more than one 'fmt ' tag\n");
-- 
1.7.7.4



More information about the ffmpeg-devel mailing list