audioencoder: don't fail if the start vfunc is not implemented
authorAndoni Morales Alastruey <ylatuya@gmail.com>
Thu, 4 Oct 2012 12:05:13 +0000 (14:05 +0200)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 4 Oct 2012 12:14:10 +0000 (13:14 +0100)
Fix behaviour to match documentation and decoder class behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=685490

gst-libs/gst/audio/gstaudioencoder.c

index 99b5ca6..73a5f37 100644 (file)
@@ -1971,8 +1971,12 @@ gst_audio_encoder_activate (GstAudioEncoder * enc, gboolean active)
     enc->priv->tags = gst_tag_list_new_empty ();
     enc->priv->tags_changed = FALSE;
 
-    if (!enc->priv->active && klass->start)
-      result = klass->start (enc);
+    if (!enc->priv->active) {
+      if (klass->start)
+        result = klass->start (enc);
+      else
+        result = TRUE;
+    }
   } else {
     /* We must make sure streaming has finished before resetting things
      * and calling the ::stop vfunc */