mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
libs/gst/base/gstbasesink.c: Sinks that don't preroll can always be queried for the latency.
Original commit message from CVS: * libs/gst/base/gstbasesink.c: (gst_base_sink_preroll_queue_flush), (gst_base_sink_event), (gst_base_sink_change_state): Sinks that don't preroll can always be queried for the latency. Don't post ASYNC start when we are not async.
This commit is contained in:
parent
f49cb86d16
commit
86bae93b0c
2 changed files with 23 additions and 7 deletions
|
@ -1,3 +1,10 @@
|
|||
2007-09-14 Wim Taymans <wim.taymans@gmail.com>
|
||||
|
||||
* libs/gst/base/gstbasesink.c: (gst_base_sink_preroll_queue_flush),
|
||||
(gst_base_sink_event), (gst_base_sink_change_state):
|
||||
Sinks that don't preroll can always be queried for the latency.
|
||||
Don't post ASYNC start when we are not async.
|
||||
|
||||
2007-09-14 Wim Taymans <wim.taymans@gmail.com>
|
||||
|
||||
* plugins/elements/gstqueue.c: (gst_queue_locked_enqueue),
|
||||
|
|
|
@ -994,9 +994,11 @@ gst_base_sink_preroll_queue_flush (GstBaseSink * basesink, GstPad * pad)
|
|||
basesink->buffers_queued = 0;
|
||||
basesink->events_queued = 0;
|
||||
/* can't report latency anymore until we preroll again */
|
||||
GST_OBJECT_LOCK (basesink);
|
||||
basesink->priv->have_latency = FALSE;
|
||||
GST_OBJECT_UNLOCK (basesink);
|
||||
if (basesink->priv->async_enabled) {
|
||||
GST_OBJECT_LOCK (basesink);
|
||||
basesink->priv->have_latency = FALSE;
|
||||
GST_OBJECT_UNLOCK (basesink);
|
||||
}
|
||||
/* and signal any waiters now */
|
||||
GST_PAD_PREROLL_SIGNAL (pad);
|
||||
}
|
||||
|
@ -2192,10 +2194,14 @@ gst_base_sink_event (GstPad * pad, GstEvent * event)
|
|||
* anymore */
|
||||
GST_PAD_STREAM_LOCK (pad);
|
||||
gst_base_sink_reset_qos (basesink);
|
||||
/* and we need to commit our state again on the next
|
||||
* prerolled buffer */
|
||||
basesink->playing_async = TRUE;
|
||||
gst_element_lost_state (GST_ELEMENT_CAST (basesink));
|
||||
if (basesink->priv->async_enabled) {
|
||||
/* and we need to commit our state again on the next
|
||||
* prerolled buffer */
|
||||
basesink->playing_async = TRUE;
|
||||
gst_element_lost_state (GST_ELEMENT_CAST (basesink));
|
||||
} else {
|
||||
basesink->priv->have_latency = TRUE;
|
||||
}
|
||||
GST_PAD_STREAM_UNLOCK (pad);
|
||||
|
||||
gst_event_unref (event);
|
||||
|
@ -3037,6 +3043,8 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition)
|
|||
ret = GST_STATE_CHANGE_ASYNC;
|
||||
gst_element_post_message (GST_ELEMENT_CAST (basesink),
|
||||
gst_message_new_async_start (GST_OBJECT_CAST (basesink), FALSE));
|
||||
} else {
|
||||
basesink->priv->have_latency = TRUE;
|
||||
}
|
||||
GST_PAD_PREROLL_UNLOCK (basesink->sinkpad);
|
||||
break;
|
||||
|
@ -3167,6 +3175,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition)
|
|||
}
|
||||
basesink->priv->current_sstart = 0;
|
||||
basesink->priv->current_sstop = 0;
|
||||
basesink->priv->have_latency = FALSE;
|
||||
GST_PAD_PREROLL_UNLOCK (basesink->sinkpad);
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
|
|
Loading…
Reference in a new issue