diff options
author | Edgard Lima <edgard.lima@indt.org.br> | 2006-01-20 17:04:38 +0000 |
---|---|---|
committer | Edgard Lima <edgard.lima@indt.org.br> | 2006-01-20 17:04:38 +0000 |
commit | a017143695a98c99002d596efe0b6d55896179ba (patch) | |
tree | c3288508b883bb6adadf1f697850fd7a3f759898 /ext | |
parent | 5e2f8a3736ddbafbd81ebe93e9c36b17caf1a5c9 (diff) | |
download | gst-plugins-bad-a017143695a98c99002d596efe0b6d55896179ba.tar.gz gst-plugins-bad-a017143695a98c99002d596efe0b6d55896179ba.tar.bz2 gst-plugins-bad-a017143695a98c99002d596efe0b6d55896179ba.zip |
Fixed state transictions PLAYING->NULL->PLAYING.
Original commit message from CVS:
Fixed state transictions PLAYING->NULL->PLAYING.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/ivorbis/vorbisfile.c | 32 | ||||
-rw-r--r-- | ext/neon/gstneonhttpsrc.c | 2 |
2 files changed, 26 insertions, 8 deletions
diff --git a/ext/ivorbis/vorbisfile.c b/ext/ivorbis/vorbisfile.c index 2de32157..0268b8c3 100644 --- a/ext/ivorbis/vorbisfile.c +++ b/ext/ivorbis/vorbisfile.c @@ -145,6 +145,7 @@ static gboolean gst_ivorbisfile_sink_activate_pull (GstPad * sinkpad, gboolean active); static void gst_ivorbisfile_loop (GstPad * pad); +static GstFlowReturn gst_ivorbisfile_play (GstPad * pad); static GstElementClass *parent_class = NULL; @@ -288,6 +289,13 @@ gst_ivorbisfile_init (Ivorbisfile * ivorbisfile) ivorbisfile->adapter = NULL; + if (ivorbisfile->metadata) { + ivorbisfile->metadata = NULL; + } + if (ivorbisfile->streaminfo) { + ivorbisfile->streaminfo = NULL; + } + } @@ -621,9 +629,7 @@ gst_ivorbisfile_chain (GstPad * pad, GstBuffer * buffer) gst_adapter_push (ivorbisfile->adapter, buffer); - gst_ivorbisfile_loop (pad); - - return GST_FLOW_OK; + return gst_ivorbisfile_play (pad); } @@ -631,12 +637,19 @@ gst_ivorbisfile_chain (GstPad * pad, GstBuffer * buffer) static void gst_ivorbisfile_loop (GstPad * pad) { + gst_ivorbisfile_play (pad); +} + +static GstFlowReturn +gst_ivorbisfile_play (GstPad * pad) +{ Ivorbisfile *ivorbisfile = GST_IVORBISFILE (gst_pad_get_parent (pad)); GstBuffer *outbuf; long ret; GstClockTime time; gint64 samples; gint link; + GstFlowReturn res = GST_FLOW_OK; if (ivorbisfile->eos) { goto done; @@ -803,7 +816,7 @@ gst_ivorbisfile_loop (GstPad * pad) ivorbisfile->total_bytes += GST_BUFFER_SIZE (outbuf); } - if (GST_FLOW_OK != gst_pad_push (ivorbisfile->srcpad, outbuf)) { + if (GST_FLOW_OK != (res = gst_pad_push (ivorbisfile->srcpad, outbuf))) { goto done; } @@ -814,6 +827,7 @@ gst_ivorbisfile_loop (GstPad * pad) done: gst_object_unref (ivorbisfile); + return res; } @@ -1309,8 +1323,14 @@ gst_ivorbisfile_change_state (GstElement * element, GstStateChange transition) ivorbisfile->offset = 0; ivorbisfile->seek_pending = 0; ivorbisfile->need_discont = FALSE; - ivorbisfile->metadata = NULL; - ivorbisfile->streaminfo = NULL; + if (ivorbisfile->metadata) { + gst_caps_unref (ivorbisfile->metadata); + ivorbisfile->metadata = NULL; + } + if (ivorbisfile->streaminfo) { + gst_caps_unref (ivorbisfile->streaminfo); + ivorbisfile->streaminfo = NULL; + } ivorbisfile->current_link = -1; ivorbisfile->rate = -1; diff --git a/ext/neon/gstneonhttpsrc.c b/ext/neon/gstneonhttpsrc.c index a7c8a192..6c0f2b0e 100644 --- a/ext/neon/gstneonhttpsrc.c +++ b/ext/neon/gstneonhttpsrc.c @@ -377,8 +377,6 @@ gst_neonhttp_src_unlock (GstBaseSrc * bsrc) GST_OBJECT_FLAG_UNSET (src, GST_NEONHTTP_SRC_OPEN); - ne_end_request (src->request); - return TRUE; } |