From d94e691beeba2ab03645a4cda2316954ddfe1809 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 16 Nov 2005 17:00:32 +0000 Subject: gst/flx/gstflxdec.c: Fix state change. Original commit message from CVS: * gst/flx/gstflxdec.c: (gst_flxdec_change_state): Fix state change. --- gst/flx/gstflxdec.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'gst/flx') diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c index 1d50a9c7..e3e4bcc8 100644 --- a/gst/flx/gstflxdec.c +++ b/gst/flx/gstflxdec.c @@ -598,6 +598,7 @@ static GstStateChangeReturn gst_flxdec_change_state (GstElement * element, GstStateChange transition) { GstFlxDec *flxdec; + GstStateChangeReturn ret; flxdec = GST_FLXDEC (element); @@ -610,21 +611,31 @@ gst_flxdec_change_state (GstElement * element, GstStateChange transition) break; case GST_STATE_CHANGE_PAUSED_TO_PLAYING: break; + default: + break; + } + + ret = parent_class->change_state (element, transition); + + switch (transition) { case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; case GST_STATE_CHANGE_PAUSED_TO_READY: - gst_buffer_unref (flxdec->frame); - flxdec->frame = NULL; - gst_buffer_unref (flxdec->delta); - flxdec->delta = NULL; + if (flxdec->frame) { + gst_buffer_unref (flxdec->frame); + flxdec->frame = NULL; + } + if (flxdec->delta) { + gst_buffer_unref (flxdec->delta); + flxdec->delta = NULL; + } break; case GST_STATE_CHANGE_READY_TO_NULL: break; + default: + break; } - - return parent_class->change_state (element, transition); - - //return GST_STATE_CHANGE_SUCCESS; + return ret; } static void -- cgit