Commit 86bae93b authored by Wim Taymans's avatar Wim Taymans
Browse files

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.
parent f49cb86d
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> 2007-09-14 Wim Taymans <wim.taymans@gmail.com>
   
* plugins/elements/gstqueue.c: (gst_queue_locked_enqueue), * plugins/elements/gstqueue.c: (gst_queue_locked_enqueue),
......
...@@ -994,9 +994,11 @@ gst_base_sink_preroll_queue_flush (GstBaseSink * basesink, GstPad * pad) ...@@ -994,9 +994,11 @@ gst_base_sink_preroll_queue_flush (GstBaseSink * basesink, GstPad * pad)
basesink->buffers_queued = 0; basesink->buffers_queued = 0;
basesink->events_queued = 0; basesink->events_queued = 0;
/* can't report latency anymore until we preroll again */ /* can't report latency anymore until we preroll again */
GST_OBJECT_LOCK (basesink); if (basesink->priv->async_enabled) {
basesink->priv->have_latency = FALSE; GST_OBJECT_LOCK (basesink);
GST_OBJECT_UNLOCK (basesink); basesink->priv->have_latency = FALSE;
GST_OBJECT_UNLOCK (basesink);
}
/* and signal any waiters now */ /* and signal any waiters now */
GST_PAD_PREROLL_SIGNAL (pad); GST_PAD_PREROLL_SIGNAL (pad);
} }
...@@ -2192,10 +2194,14 @@ gst_base_sink_event (GstPad * pad, GstEvent * event) ...@@ -2192,10 +2194,14 @@ gst_base_sink_event (GstPad * pad, GstEvent * event)
* anymore */ * anymore */
GST_PAD_STREAM_LOCK (pad); GST_PAD_STREAM_LOCK (pad);
gst_base_sink_reset_qos (basesink); gst_base_sink_reset_qos (basesink);
/* and we need to commit our state again on the next if (basesink->priv->async_enabled) {
* prerolled buffer */ /* and we need to commit our state again on the next
basesink->playing_async = TRUE; * prerolled buffer */
gst_element_lost_state (GST_ELEMENT_CAST (basesink)); basesink->playing_async = TRUE;
gst_element_lost_state (GST_ELEMENT_CAST (basesink));
} else {
basesink->priv->have_latency = TRUE;
}
GST_PAD_STREAM_UNLOCK (pad); GST_PAD_STREAM_UNLOCK (pad);
gst_event_unref (event); gst_event_unref (event);
...@@ -3037,6 +3043,8 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition) ...@@ -3037,6 +3043,8 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition)
ret = GST_STATE_CHANGE_ASYNC; ret = GST_STATE_CHANGE_ASYNC;
gst_element_post_message (GST_ELEMENT_CAST (basesink), gst_element_post_message (GST_ELEMENT_CAST (basesink),
gst_message_new_async_start (GST_OBJECT_CAST (basesink), FALSE)); gst_message_new_async_start (GST_OBJECT_CAST (basesink), FALSE));
} else {
basesink->priv->have_latency = TRUE;
} }
GST_PAD_PREROLL_UNLOCK (basesink->sinkpad); GST_PAD_PREROLL_UNLOCK (basesink->sinkpad);
break; break;
...@@ -3167,6 +3175,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition) ...@@ -3167,6 +3175,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition)
} }
basesink->priv->current_sstart = 0; basesink->priv->current_sstart = 0;
basesink->priv->current_sstop = 0; basesink->priv->current_sstop = 0;
basesink->priv->have_latency = FALSE;
GST_PAD_PREROLL_UNLOCK (basesink->sinkpad); GST_PAD_PREROLL_UNLOCK (basesink->sinkpad);
break; break;
case GST_STATE_CHANGE_READY_TO_NULL: case GST_STATE_CHANGE_READY_TO_NULL:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment