mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
gst-libs/gst/audio/gstbaseaudiosink.c: Use gst_base_sink_do_preroll() to wait for PLAYING and before waiting for the ...
Original commit message from CVS: * gst-libs/gst/audio/gstbaseaudiosink.c: (gst_base_audio_sink_sync_latency), (gst_base_audio_sink_render), (gst_base_audio_sink_callback): Use gst_base_sink_do_preroll() to wait for PLAYING and before waiting for the latency to expire, fixes #559567.
This commit is contained in:
parent
9b6f3ad0c8
commit
e701e64005
2 changed files with 17 additions and 12 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2008-11-10 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* gst-libs/gst/audio/gstbaseaudiosink.c:
|
||||||
|
(gst_base_audio_sink_sync_latency), (gst_base_audio_sink_render),
|
||||||
|
(gst_base_audio_sink_callback):
|
||||||
|
Use gst_base_sink_do_preroll() to wait for PLAYING and before waiting
|
||||||
|
for the latency to expire, fixes #559567.
|
||||||
|
|
||||||
2008-11-10 Thomas Vander Stichele <thomas at apestaart dot org>
|
2008-11-10 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* gst/adder/gstadder.c:
|
* gst/adder/gstadder.c:
|
||||||
|
|
|
@ -1082,7 +1082,7 @@ gst_base_audio_sink_handle_slaving (GstBaseAudioSink * sink,
|
||||||
|
|
||||||
/* must be called with LOCK */
|
/* must be called with LOCK */
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_base_audio_sink_sync_latency (GstBaseSink * bsink)
|
gst_base_audio_sink_sync_latency (GstBaseSink * bsink, GstMiniObject * obj)
|
||||||
{
|
{
|
||||||
GstClock *clock;
|
GstClock *clock;
|
||||||
GstClockReturn status;
|
GstClockReturn status;
|
||||||
|
@ -1108,12 +1108,9 @@ gst_base_audio_sink_sync_latency (GstBaseSink * bsink)
|
||||||
do {
|
do {
|
||||||
GST_DEBUG_OBJECT (sink, "checking preroll");
|
GST_DEBUG_OBJECT (sink, "checking preroll");
|
||||||
|
|
||||||
/* first wait for the playing state before we can continue */
|
ret = gst_base_sink_do_preroll (bsink, obj);
|
||||||
if (G_UNLIKELY (bsink->need_preroll)) {
|
if (ret != GST_FLOW_OK)
|
||||||
ret = gst_base_sink_wait_preroll (bsink);
|
goto flushing;
|
||||||
if (ret != GST_FLOW_OK)
|
|
||||||
goto flushing;
|
|
||||||
}
|
|
||||||
|
|
||||||
GST_OBJECT_LOCK (sink);
|
GST_OBJECT_LOCK (sink);
|
||||||
time = sink->priv->us_latency;
|
time = sink->priv->us_latency;
|
||||||
|
@ -1242,12 +1239,12 @@ gst_base_audio_sink_render (GstBaseSink * bsink, GstBuffer * buf)
|
||||||
GST_OBJECT_LOCK (sink);
|
GST_OBJECT_LOCK (sink);
|
||||||
base_time = GST_ELEMENT_CAST (sink)->base_time;
|
base_time = GST_ELEMENT_CAST (sink)->base_time;
|
||||||
if (G_UNLIKELY (sink->priv->sync_latency)) {
|
if (G_UNLIKELY (sink->priv->sync_latency)) {
|
||||||
/* only do this once until we are set back to PLAYING */
|
ret = gst_base_audio_sink_sync_latency (bsink, GST_MINI_OBJECT_CAST (buf));
|
||||||
sink->priv->sync_latency = FALSE;
|
|
||||||
ret = gst_base_audio_sink_sync_latency (bsink);
|
|
||||||
GST_OBJECT_UNLOCK (sink);
|
GST_OBJECT_UNLOCK (sink);
|
||||||
if (G_UNLIKELY (ret != GST_FLOW_OK))
|
if (G_UNLIKELY (ret != GST_FLOW_OK))
|
||||||
goto sync_latency_failed;
|
goto sync_latency_failed;
|
||||||
|
/* only do this once until we are set back to PLAYING */
|
||||||
|
sink->priv->sync_latency = FALSE;
|
||||||
} else {
|
} else {
|
||||||
GST_OBJECT_UNLOCK (sink);
|
GST_OBJECT_UNLOCK (sink);
|
||||||
}
|
}
|
||||||
|
@ -1644,8 +1641,8 @@ gst_base_audio_sink_callback (GstRingBuffer * rbuf, guint8 * data, guint len,
|
||||||
|
|
||||||
error:
|
error:
|
||||||
{
|
{
|
||||||
GST_WARNING_OBJECT (basesink, "Got flow error but can't return it: %d",
|
GST_WARNING_OBJECT (basesink, "Got flow '%s' but can't return it: %d",
|
||||||
ret);
|
gst_flow_get_name (ret), ret);
|
||||||
gst_ring_buffer_pause (rbuf);
|
gst_ring_buffer_pause (rbuf);
|
||||||
GST_PAD_STREAM_UNLOCK (basesink->sinkpad);
|
GST_PAD_STREAM_UNLOCK (basesink->sinkpad);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue