sys/xvimage/xvimagesink.c: Make state change function thread safe.

Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_change_state):
Make state change function thread safe.
This commit is contained in:
Tim-Philipp Müller 2005-11-15 19:01:43 +00:00
parent 8c392fb611
commit 533d7d68c3
2 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2005-11-15 Tim-Philipp Müller <tim at centricular dot net>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_change_state):
Make state change function thread safe.
2005-11-15 Edward Hervey <edward@fluendo.com> 2005-11-15 Edward Hervey <edward@fluendo.com>
* ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event), * ext/ogg/gstoggdemux.c: (gst_ogg_demux_receive_event),

View file

@ -1444,6 +1444,7 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
static GstStateChangeReturn static GstStateChangeReturn
gst_xvimagesink_change_state (GstElement * element, GstStateChange transition) gst_xvimagesink_change_state (GstElement * element, GstStateChange transition)
{ {
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
GstXvImageSink *xvimagesink; GstXvImageSink *xvimagesink;
xvimagesink = GST_XVIMAGESINK (element); xvimagesink = GST_XVIMAGESINK (element);
@ -1472,6 +1473,15 @@ gst_xvimagesink_change_state (GstElement * element, GstStateChange transition)
break; break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING: case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break; break;
default:
break;
}
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
if (ret == GST_STATE_CHANGE_FAILURE)
return ret;
switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED: case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break; break;
case GST_STATE_CHANGE_PAUSED_TO_READY: case GST_STATE_CHANGE_PAUSED_TO_READY:
@ -1498,9 +1508,11 @@ gst_xvimagesink_change_state (GstElement * element, GstStateChange transition)
xvimagesink->xcontext = NULL; xvimagesink->xcontext = NULL;
} }
break; break;
default:
break;
} }
return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); return ret;
} }
static void static void