omxvideoenc: Drop EOS events in ::finish()
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 5 Dec 2011 07:12:48 +0000 (08:12 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 5 Dec 2011 07:12:48 +0000 (08:12 +0100)
The event will be forwarded downstream from the srcpad
loop function after the last buffer was generated by the
component. Forwarding it after ::finish() will use the
sinkpad streaming thread and does not guarantee that
the encoder is completely drained.

omx/gstomxvideoenc.c

index 34ec8d9..4bec814 100644 (file)
@@ -1505,7 +1505,7 @@ buffer_fill_error:
   }
 }
 
-static gboolean
+static GstFlowReturn
 gst_omx_video_enc_finish (GstBaseVideoEncoder * encoder)
 {
   GstOMXVideoEnc *self;
@@ -1519,7 +1519,7 @@ gst_omx_video_enc_finish (GstBaseVideoEncoder * encoder)
   /* Don't send EOS buffer twice, this doesn't work */
   if (self->eos) {
     GST_DEBUG_OBJECT (self, "Component is already EOS");
-    return TRUE;
+    return GST_BASE_VIDEO_ENCODER_FLOW_DROPPED;
   }
   self->eos = TRUE;
 
@@ -1542,7 +1542,7 @@ gst_omx_video_enc_finish (GstBaseVideoEncoder * encoder)
 
   GST_BASE_VIDEO_CODEC_STREAM_LOCK (self);
 
-  return TRUE;
+  return GST_BASE_VIDEO_ENCODER_FLOW_DROPPED;
 }
 
 static GstFlowReturn