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:
Wim Taymans 2007-09-14 23:06:31 +00:00
parent f49cb86d16
commit 86bae93b0c
2 changed files with 23 additions and 7 deletions

View file

@ -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> 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),

View file

@ -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)
* 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)
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)
} }
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: