From 92c26f684aeb2933453c72ce42f7d494d8737cc2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 9 Nov 2011 15:44:11 +0100 Subject: [PATCH] omxvideodec: Improve EOS handling If downstream return UNEXPECTED we should still signal the drain cond because nothing will trigger this again later. --- omx/gstomxvideodec.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 1e105c5..1d63d9f 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -763,15 +763,20 @@ gst_omx_video_dec_loop (GstOMXVideoDec * self) } GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (self); - if (flow_ret == GST_FLOW_OK && (buf->omx_buf->nFlags & OMX_BUFFERFLAG_EOS)) { + if ((flow_ret == GST_FLOW_OK && (buf->omx_buf->nFlags & OMX_BUFFERFLAG_EOS)) + || flow_ret == GST_FLOW_UNEXPECTED) { g_mutex_lock (self->drain_lock); if (self->draining) { + GST_DEBUG_OBJECT (self, "Drained"); self->draining = FALSE; g_cond_broadcast (self->drain_cond); - } else { + } else if (flow_ret == GST_FLOW_OK) { + GST_DEBUG_OBJECT (self, "Component signalled EOS"); flow_ret = GST_FLOW_UNEXPECTED; } g_mutex_unlock (self->drain_lock); + } else { + GST_DEBUG_OBJECT (self, "Finished frame: %s", gst_flow_get_name (flow_ret)); } gst_omx_port_release_buffer (port, buf); -- 2.7.4