summaryrefslogtreecommitdiff
path: root/sys/androidmedia/gstamcaudiodec.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-08-14 15:26:53 +0300
committerSebastian Dröge <sebastian@centricular.com>2014-08-14 15:27:21 +0300
commit8f25220b9c0426c38122419060cbbc63ab1a74d2 (patch)
tree48ebc2557563aee3f7907a8bb3403f6de37e926d /sys/androidmedia/gstamcaudiodec.c
parentca62186797271ebda3966fd9f0de3b961c83c50e (diff)
downloadgstreamer-plugins-bad-8f25220b9c0426c38122419060cbbc63ab1a74d2.tar.gz
androidmedia: Make sure to unblock any thread waiting on the drain condition variable when errors happen
Diffstat (limited to 'sys/androidmedia/gstamcaudiodec.c')
-rw-r--r--sys/androidmedia/gstamcaudiodec.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/androidmedia/gstamcaudiodec.c b/sys/androidmedia/gstamcaudiodec.c
index 1025bf973..eabe27d4b 100644
--- a/sys/androidmedia/gstamcaudiodec.c
+++ b/sys/androidmedia/gstamcaudiodec.c
@@ -603,6 +603,10 @@ dequeue_error:
gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self));
self->downstream_flow_ret = GST_FLOW_ERROR;
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
+ g_mutex_lock (&self->drain_lock);
+ self->draining = FALSE;
+ g_cond_broadcast (&self->drain_cond);
+ g_mutex_unlock (&self->drain_lock);
return;
}
@@ -613,6 +617,10 @@ get_output_buffers_error:
gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self));
self->downstream_flow_ret = GST_FLOW_ERROR;
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
+ g_mutex_lock (&self->drain_lock);
+ self->draining = FALSE;
+ g_cond_broadcast (&self->drain_cond);
+ g_mutex_unlock (&self->drain_lock);
return;
}
@@ -627,6 +635,10 @@ format_error:
gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self));
self->downstream_flow_ret = GST_FLOW_ERROR;
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
+ g_mutex_lock (&self->drain_lock);
+ self->draining = FALSE;
+ g_cond_broadcast (&self->drain_cond);
+ g_mutex_unlock (&self->drain_lock);
return;
}
failed_release:
@@ -636,6 +648,10 @@ failed_release:
gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self));
self->downstream_flow_ret = GST_FLOW_ERROR;
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
+ g_mutex_lock (&self->drain_lock);
+ self->draining = FALSE;
+ g_cond_broadcast (&self->drain_cond);
+ g_mutex_unlock (&self->drain_lock);
return;
}
flushing:
@@ -666,6 +682,10 @@ flow_error:
gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self));
}
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
+ g_mutex_lock (&self->drain_lock);
+ self->draining = FALSE;
+ g_cond_broadcast (&self->drain_cond);
+ g_mutex_unlock (&self->drain_lock);
return;
}
@@ -677,6 +697,10 @@ invalid_buffer_index:
gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self));
self->downstream_flow_ret = GST_FLOW_ERROR;
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
+ g_mutex_lock (&self->drain_lock);
+ self->draining = FALSE;
+ g_cond_broadcast (&self->drain_cond);
+ g_mutex_unlock (&self->drain_lock);
return;
}
invalid_buffer_size:
@@ -691,6 +715,10 @@ invalid_buffer_size:
gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self));
self->downstream_flow_ret = GST_FLOW_ERROR;
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
+ g_mutex_lock (&self->drain_lock);
+ self->draining = FALSE;
+ g_cond_broadcast (&self->drain_cond);
+ g_mutex_unlock (&self->drain_lock);
return;
}
@@ -706,6 +734,10 @@ failed_allocate:
gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self));
self->downstream_flow_ret = GST_FLOW_ERROR;
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
+ g_mutex_lock (&self->drain_lock);
+ self->draining = FALSE;
+ g_cond_broadcast (&self->drain_cond);
+ g_mutex_unlock (&self->drain_lock);
return;
}
}