summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreunhae choi <eunhae1.choi@samsung.com>2015-09-14 15:25:11 +0900
committerSebastian Dröge <sebastian@centricular.com>2015-10-20 10:16:20 +0300
commit7d11a78f06d76fb7d453cc62399514fbebc08f47 (patch)
treea2a6f7d5278ecd201d82c78485552174187eece4
parentbca12f39b8ffab17140d99a375126c0aea04a9db (diff)
downloadgstreamer-plugins-base-7d11a78f06d76fb7d453cc62399514fbebc08f47.tar.gz
audiobasesink: fix issue about eos handling during flushing
If the flush-start is arrived during _eos_wait() in basesink, the 'eos' flag is overwritten to TRUE after exiting the _eos_wait(). To resolve the overwritten issue, the subclass doing the _eos_wait() call should return the right value. If the eos flag is set to TRUE again, it will cause error(enter the eos flow) of the following state changing from PAUSED to PLAYING in basesink. https://bugzilla.gnome.org/show_bug.cgi?id=754980
-rw-r--r--gst-libs/gst/audio/gstaudiobasesink.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gst-libs/gst/audio/gstaudiobasesink.c b/gst-libs/gst/audio/gstaudiobasesink.c
index 704801e45..45050224f 100644
--- a/gst-libs/gst/audio/gstaudiobasesink.c
+++ b/gst-libs/gst/audio/gstaudiobasesink.c
@@ -1086,13 +1086,14 @@ gst_audio_base_sink_force_start (GstAudioBaseSink * sink)
}
/* This waits for the drain to happen and can be canceled */
-static gboolean
+static GstFlowReturn
gst_audio_base_sink_drain (GstAudioBaseSink * sink)
{
+ GstFlowReturn ret = GST_FLOW_OK;
if (!sink->ringbuffer)
- return TRUE;
+ return ret;
if (!sink->ringbuffer->spec.info.rate)
- return TRUE;
+ return ret;
/* if PLAYING is interrupted,
* arrange to have clock running when going to PLAYING again */
@@ -1111,19 +1112,19 @@ gst_audio_base_sink_drain (GstAudioBaseSink * sink)
/* wait for the EOS time to be reached, this is the time when the last
* sample is played. */
- gst_base_sink_wait (GST_BASE_SINK (sink), sink->priv->eos_time, NULL);
+ ret = gst_base_sink_wait (GST_BASE_SINK (sink), sink->priv->eos_time, NULL);
GST_DEBUG_OBJECT (sink, "drained audio");
}
g_atomic_int_set (&sink->eos_rendering, 0);
- return TRUE;
+ return ret;
}
static GstFlowReturn
gst_audio_base_sink_wait_event (GstBaseSink * bsink, GstEvent * event)
{
GstAudioBaseSink *sink = GST_AUDIO_BASE_SINK (bsink);
- GstFlowReturn ret;
+ GstFlowReturn ret = GST_FLOW_OK;
gboolean clear_force_start_flag = FALSE;
/* For both gap and EOS events, make sure the ringbuffer is running
@@ -1155,7 +1156,7 @@ gst_audio_base_sink_wait_event (GstBaseSink * bsink, GstEvent * event)
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
/* now wait till we played everything */
- gst_audio_base_sink_drain (sink);
+ ret = gst_audio_base_sink_drain (sink);
break;
default:
break;