From 0056a06bd0318e11a44d3cd249f3e0acd40e705f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 20 Jan 2003 21:24:37 +0000 Subject: - Fix bytestream flush Original commit message from CVS: - Fix bytestream flush - Add workaround for spider bug --- gst/modplug/gstmodplug.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gst/modplug/gstmodplug.cc b/gst/modplug/gstmodplug.cc index 8329eadd5..2951744a6 100644 --- a/gst/modplug/gstmodplug.cc +++ b/gst/modplug/gstmodplug.cc @@ -677,6 +677,9 @@ gst_modplug_loop (GstElement *element) modplug->mSoundFile->Create (modplug->buffer_in, modplug->song_size); + gst_bytestream_flush (modplug->bs, modplug->song_size); + modplug->buffer_in = NULL; + modplug->audiobuffer = (guchar *) g_malloc (modplug->length); gst_modplug_update_metadata (modplug); @@ -731,8 +734,11 @@ gst_modplug_loop (GstElement *element) gst_pad_push (modplug->srcpad, buffer_out); } else - if (GST_PAD_IS_USABLE (modplug->srcpad)) + if (GST_PAD_IS_LINKED (modplug->srcpad)) { + /* FIXME, hack, pull final EOS from peer */ + gst_bytestream_flush (modplug->bs, 1); + event = gst_event_new (GST_EVENT_EOS); gst_pad_push (modplug->srcpad, GST_BUFFER (event)); gst_element_set_eos (element); @@ -767,9 +773,8 @@ gst_modplug_change_state (GstElement *element) gst_bytestream_destroy (modplug->bs); modplug->mSoundFile->Destroy (); g_free (modplug->audiobuffer); - g_free (modplug->buffer_in); - modplug->audiobuffer = NULL; modplug->buffer_in = NULL; + modplug->audiobuffer = NULL; gst_caps_unref (modplug->streaminfo); modplug->state = MODPLUG_STATE_NEED_TUNE; break; -- cgit v1.2.1