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. --- ChangeLog | 5 +++++ common | 2 +- gst/flx/gstflxdec.c | 27 +++++++++++++++++++-------- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef255420..0ba9c21b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-16 Wim Taymans + + * gst/flx/gstflxdec.c: (gst_flxdec_change_state): + Fix state change. + 2005-11-16 Andy Wingo * gst/udp/gstudpsrc.c: Clean up with the boilerplate macro. diff --git a/common b/common index 657b549d..3aa0adc0 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 657b549dfb640a76f3d7ab7676e453c801a83dca +Subproject commit 3aa0adc0cc4539ec9bb62ccf6d535240dad19e58 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