mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
playbin2: sync state of the sink correctly
Sync the state of the newly added chains to the state of the parent sink element to avoid lost async-start messages. Fixes cdda:// async-done message storm.
This commit is contained in:
parent
a8579ffea0
commit
da6a544bdf
1 changed files with 7 additions and 1 deletions
|
@ -632,11 +632,17 @@ add_chain (GstPlayChain * chain, gboolean add)
|
||||||
static gboolean
|
static gboolean
|
||||||
activate_chain (GstPlayChain * chain, gboolean activate)
|
activate_chain (GstPlayChain * chain, gboolean activate)
|
||||||
{
|
{
|
||||||
|
GstState state;
|
||||||
|
|
||||||
if (chain->activated == activate)
|
if (chain->activated == activate)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
GST_OBJECT_LOCK (chain->playsink);
|
||||||
|
state = GST_STATE_TARGET (chain->playsink);
|
||||||
|
GST_OBJECT_UNLOCK (chain->playsink);
|
||||||
|
|
||||||
if (activate)
|
if (activate)
|
||||||
gst_element_set_state (chain->bin, GST_STATE_PAUSED);
|
gst_element_set_state (chain->bin, state);
|
||||||
else
|
else
|
||||||
gst_element_set_state (chain->bin, GST_STATE_NULL);
|
gst_element_set_state (chain->bin, GST_STATE_NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue