mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
pulsesink: clean up the state change function
Make the state change function a bit more readable and only pause after the parent had a change to pause first.
This commit is contained in:
parent
cc1a869a2c
commit
39f59ea456
1 changed files with 12 additions and 10 deletions
|
@ -1243,23 +1243,25 @@ unlock:
|
|||
static GstStateChangeReturn
|
||||
gst_pulsesink_change_state (GstElement * element, GstStateChange transition)
|
||||
{
|
||||
GstStateChangeReturn res;
|
||||
GstPulseSink *this = GST_PULSESINK (element);
|
||||
|
||||
switch (transition) {
|
||||
|
||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||
|
||||
gst_pulsesink_pause (this,
|
||||
GST_STATE_TRANSITION_NEXT (transition) == GST_STATE_PAUSED);
|
||||
gst_pulsesink_pause (this, FALSE);
|
||||
break;
|
||||
|
||||
default:
|
||||
;
|
||||
break;
|
||||
}
|
||||
|
||||
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
||||
return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
||||
res = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
||||
|
||||
return GST_STATE_CHANGE_SUCCESS;
|
||||
switch (transition) {
|
||||
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
||||
gst_pulsesink_pause (this, TRUE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue