changeset 32263:b8cd2b5c4d35

Minor simplification of af_init.
author reimar
date Sat, 25 Sep 2010 11:55:56 +0000
parents f67e85fc1f7a
children f1884cb8d0ee
files libaf/af.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libaf/af.c	Sat Sep 25 10:49:39 2010 +0000
+++ b/libaf/af.c	Sat Sep 25 11:55:56 2010 +0000
@@ -439,11 +439,7 @@
   // Check if this is the first call
   if(!s->first){
     // Add all filters in the list (if there are any)
-    if(!s->cfg.list){      // To make automatic format conversion work
-      if(!af_append(s,s->first,"dummy"))
-	return -1;
-    }
-    else{
+    if (s->cfg.list) {
       while(s->cfg.list[i]){
 	if(!af_append(s,s->last,s->cfg.list[i++]))
 	  return -1;
@@ -451,6 +447,11 @@
     }
   }
 
+  // If we do not have any filters otherwise
+  // add dummy to make automatic format conversion work
+  if (!s->first && !af_append(s, s->first, "dummy"))
+    return -1;
+
   // Init filters
   if(AF_OK != af_reinit(s,s->first))
     return -1;