diff options
author | Enrique Ocaña González <eocanha@igalia.com> | 2015-11-18 12:59:59 +0000 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-11-18 15:18:02 +0200 |
commit | d1a79d7c591fbe68f2048bcfb02a14ba49c312e4 (patch) | |
tree | fcf290debe5055a77705c03e65276b5e4b798345 /omx/gstomxaudiodec.c | |
parent | 9adf0ff82903cad5331e40975ae91ed5d11bc102 (diff) | |
download | gst-omx-d1a79d7c591fbe68f2048bcfb02a14ba49c312e4.tar.gz |
Properly handle drain requests while flushing
Without this commit the decoder streaming thread stops without ever attending
the drain request, leaving the decoder input thread waiting forever.
https://bugzilla.gnome.org/show_bug.cgi?id=758274
Diffstat (limited to 'omx/gstomxaudiodec.c')
-rw-r--r-- | omx/gstomxaudiodec.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/omx/gstomxaudiodec.c b/omx/gstomxaudiodec.c index 9b84555..b6fdf34 100644 --- a/omx/gstomxaudiodec.c +++ b/omx/gstomxaudiodec.c @@ -599,9 +599,15 @@ component_error: flushing: { GST_DEBUG_OBJECT (self, "Flushing -- stopping task"); + g_mutex_lock (&self->drain_lock); + if (self->draining) { + self->draining = FALSE; + g_cond_broadcast (&self->drain_cond); + } gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self)); self->downstream_flow_ret = GST_FLOW_FLUSHING; self->started = FALSE; + g_mutex_unlock (&self->drain_lock); return; } @@ -673,8 +679,14 @@ flow_error: self->started = FALSE; } else if (flow_ret == GST_FLOW_FLUSHING) { GST_DEBUG_OBJECT (self, "Flushing -- stopping task"); + g_mutex_lock (&self->drain_lock); + if (self->draining) { + self->draining = FALSE; + g_cond_broadcast (&self->drain_cond); + } gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self)); self->started = FALSE; + g_mutex_unlock (&self->drain_lock); } GST_AUDIO_DECODER_STREAM_UNLOCK (self); return; |