ext/libpng/gstpngdec.c: Make state change function thread-safe.

Original commit message from CVS:
* ext/libpng/gstpngdec.c: (gst_pngdec_change_state):
Make state change function thread-safe.
This commit is contained in:
Tim-Philipp Müller 2006-03-23 19:57:34 +00:00
parent 459333b3c0
commit 38c2bcc170
2 changed files with 16 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2006-03-23 Tim-Philipp Müller <tim at centricular dot net>
* ext/libpng/gstpngdec.c: (gst_pngdec_change_state):
Make state change function thread-safe.
2006-03-23 Tim-Philipp Müller <tim at centricular dot net>
* gst/wavparse/gstwavparse.c: (gst_wavparse_get_upstream_size),

View file

@ -592,8 +592,8 @@ beach:
static GstStateChangeReturn
gst_pngdec_change_state (GstElement * element, GstStateChange transition)
{
GstStateChangeReturn ret = GST_STATE_CHANGE_FAILURE;
GstPngDec *pngdec = NULL;
GstStateChangeReturn ret;
GstPngDec *pngdec;
pngdec = GST_PNGDEC (element);
@ -601,6 +601,15 @@ gst_pngdec_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_READY_TO_PAUSED:
gst_pngdec_libpng_init (pngdec);
break;
default:
break;
}
ret = parent_class->change_state (element, transition);
if (ret != GST_STATE_CHANGE_SUCCESS)
return ret;
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_pngdec_libpng_clear (pngdec);
break;
@ -608,8 +617,6 @@ gst_pngdec_change_state (GstElement * element, GstStateChange transition)
break;
}
ret = parent_class->change_state (element, transition);
return ret;
}