Fixed state transictions PLAYING->NULL->PLAYING.

Original commit message from CVS:
Fixed state transictions PLAYING->NULL->PLAYING.
This commit is contained in:
Edgard Lima 2006-01-20 17:04:38 +00:00
parent 5e2f8a3736
commit a017143695
4 changed files with 33 additions and 9 deletions

View file

@ -1,3 +1,9 @@
2006-01-20 Edgard Lima <edgard.lima@indt.org.br>
* ext/ivorbis/vorbisfile.c:
* ext/neon/gstneonhttpsrc.c:
Fixed state transictions PLAYING->NULL->PLAYING.
2006-01-19 Edgard Lima <edgard.lima@indt.org.br>
* ext/tremor/vorbisfile.c:

2
common

@ -1 +1 @@
Subproject commit e0b121388ece524c0b7035a72bddd191d122d8bf
Subproject commit 5d64704708b8ec2bff66d095269dd5791f7a94b3

View file

@ -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,15 +629,19 @@ 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);
}
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;
@ -637,6 +649,7 @@ gst_ivorbisfile_loop (GstPad * pad)
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;

View file

@ -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;
}