[FFmpeg-soc] [soc]: r1878 - libavfilter/formats.c

vitor subversion at mplayerhq.hu
Sun Feb 10 00:28:03 CET 2008


Author: vitor
Date: Sun Feb 10 00:28:03 2008
New Revision: 1878

Log:
Coding style changes

Modified:
   libavfilter/formats.c

Modified: libavfilter/formats.c
==============================================================================
--- libavfilter/formats.c	(original)
+++ libavfilter/formats.c	Sun Feb 10 00:28:03 2008
@@ -51,8 +51,9 @@ AVFilterFormats *avfilter_merge_formats(
             if(a->formats[i] == b->formats[j])
                 ret->formats[k++] = a->formats[i];
 
+    ret->format_count = k;
     /* check that there was at least one common format */
-    if(!(ret->format_count = k)) {
+    if(!ret->format_count) {
         av_free(ret->formats);
         av_free(ret);
         return NULL;
@@ -117,9 +118,9 @@ static int find_ref_index(AVFilterFormat
 
 void avfilter_formats_unref(AVFilterFormats **ref)
 {
-    int idx;
+    int idx = find_ref_index(ref);
 
-    if((idx = find_ref_index(ref)) >= 0)
+    if(idx >= 0)
         memmove((*ref)->refs + idx, (*ref)->refs + idx+1,
             sizeof(AVFilterFormats**) * ((*ref)->refcount-idx-1));
 
@@ -134,9 +135,9 @@ void avfilter_formats_unref(AVFilterForm
 void avfilter_formats_changeref(AVFilterFormats **oldref,
                                 AVFilterFormats **newref)
 {
-    int idx;
+    int idx = find_ref_index(oldref);
 
-    if((idx = find_ref_index(oldref)) >= 0) {
+    if(idx >= 0) {
         (*oldref)->refs[idx] = newref;
         *newref = *oldref;
         *oldref = NULL;



More information about the FFmpeg-soc mailing list