From 781e61d56913fbd0efe5cb500dca8e89dabb3d76 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 5 Dec 2011 08:12:48 +0100 Subject: [PATCH] omxvideoenc: Drop EOS events in ::finish() 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index 34ec8d9..4bec814 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -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 -- 2.7.4