diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2003-01-20 21:24:37 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2003-01-20 21:24:37 +0000 |
commit | 0056a06bd0318e11a44d3cd249f3e0acd40e705f (patch) | |
tree | a0e77b5aec7004f647a22b635df8ccdad802c569 /gst/modplug/gstmodplug.cc | |
parent | 6f92032333c89d168b400d826dbae46506d97aac (diff) | |
download | gst-plugins-bad-0056a06bd0318e11a44d3cd249f3e0acd40e705f.tar.gz gst-plugins-bad-0056a06bd0318e11a44d3cd249f3e0acd40e705f.tar.bz2 gst-plugins-bad-0056a06bd0318e11a44d3cd249f3e0acd40e705f.zip |
- Fix bytestream flush
Original commit message from CVS:
- Fix bytestream flush
- Add workaround for spider bug
Diffstat (limited to 'gst/modplug/gstmodplug.cc')
-rw-r--r-- | gst/modplug/gstmodplug.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gst/modplug/gstmodplug.cc b/gst/modplug/gstmodplug.cc index 8329eadd..2951744a 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; |