visual: handle the return of the setup function
authorLuis de Bethencourt <luis.bg@samsung.com>
Tue, 13 Jan 2015 16:36:09 +0000 (16:36 +0000)
committerLuis de Bethencourt <luis.bg@samsung.com>
Tue, 13 Jan 2015 16:36:09 +0000 (16:36 +0000)
Make the baseclass future proof by handling the gboolean return of the setup
function. So if/when a child class uses this the base class is ready.

ext/libvisual/gstaudiovisualizer.c

index 639f1e4..3aac927 100644 (file)
@@ -750,8 +750,8 @@ gst_audio_visualizer_src_setcaps (GstAudioVisualizer * scope, GstCaps * caps)
   gst_video_frame_map (&scope->tempframe, &scope->vinfo, scope->tempbuf,
       GST_MAP_READWRITE);
 
-  if (klass->setup)
-    res = klass->setup (scope);
+  if (klass->setup && !klass->setup)
+    goto setup_failed;
 
   GST_DEBUG_OBJECT (scope, "video: dimension %dx%d, framerate %d/%d",
       GST_VIDEO_INFO_WIDTH (&info), GST_VIDEO_INFO_HEIGHT (&info),
@@ -772,6 +772,12 @@ wrong_caps:
     GST_DEBUG_OBJECT (scope, "error parsing caps");
     return FALSE;
   }
+
+setup_failed:
+  {
+    GST_WARNING_OBJECT (scope, "failed to set up");
+    return FALSE;
+  }
 }
 
 static gboolean