diff --git a/ChangeLog b/ChangeLog index 6cf0f8c51e..af61cf6ce0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-03-23 Tim-Philipp Müller + + * ext/libpng/gstpngdec.c: (gst_pngdec_change_state): + Make state change function thread-safe. + 2006-03-23 Tim-Philipp Müller * gst/wavparse/gstwavparse.c: (gst_wavparse_get_upstream_size), diff --git a/ext/libpng/gstpngdec.c b/ext/libpng/gstpngdec.c index 684232888c..9bf672ce60 100644 --- a/ext/libpng/gstpngdec.c +++ b/ext/libpng/gstpngdec.c @@ -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; }