audioencoder: Don't return not-negotiated if flushing
authorSebastian Dröge <slomo@circular-chaos.org>
Sun, 30 Jun 2013 16:16:35 +0000 (18:16 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Sun, 30 Jun 2013 16:17:42 +0000 (18:17 +0200)
If the pad is flushing after a failed negotiation, return
GST_FLOW_FLUSHING instead from finish_frame().

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

gst-libs/gst/audio/gstaudioencoder.c

index 43f47e31918745a5a321784dc900ffe7b229cdc3..bc78b6bc58e76edaaafe41f6253bb3d976a01063 100644 (file)
@@ -627,7 +627,10 @@ gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf,
   if (G_UNLIKELY (ctx->output_caps_changed
           || gst_pad_check_reconfigure (enc->srcpad))) {
     if (!gst_audio_encoder_negotiate (enc)) {
-      ret = GST_FLOW_NOT_NEGOTIATED;
+      if (GST_PAD_IS_FLUSHING (enc->srcpad))
+        ret = GST_FLOW_FLUSHING;
+      else
+        ret = GST_FLOW_NOT_NEGOTIATED;
       goto exit;
     }
   }