summaryrefslogtreecommitdiffstats
path: root/gst/modplug/gstmodplug.cc
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2004-03-14 12:40:57 +0000
committerBenjamin Otte <otte@gnome.org>2004-03-14 12:40:57 +0000
commit94f1403b7b476849d62621d22ba0530fe7ab7216 (patch)
treed6f11ac2bb3d4e12bf69e03e8d29a313ddb190ad /gst/modplug/gstmodplug.cc
parent7dc81ddbcce806c74f57890577ee49dc300b8dde (diff)
downloadgst-plugins-bad-94f1403b7b476849d62621d22ba0530fe7ab7216.tar.gz
gst-plugins-bad-94f1403b7b476849d62621d22ba0530fe7ab7216.tar.bz2
gst-plugins-bad-94f1403b7b476849d62621d22ba0530fe7ab7216.zip
gst/modplug/gstmodplug.cc: handle events - don't do crap when a discont arrives that's not necessary
Original commit message from CVS: * gst/modplug/gstmodplug.cc: handle events - don't do crap when a discont arrives that's not necessary This allows correct loading and playback of mods in Rhythmbox
Diffstat (limited to 'gst/modplug/gstmodplug.cc')
-rw-r--r--gst/modplug/gstmodplug.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/gst/modplug/gstmodplug.cc b/gst/modplug/gstmodplug.cc
index c4f143d5..06701c6d 100644
--- a/gst/modplug/gstmodplug.cc
+++ b/gst/modplug/gstmodplug.cc
@@ -270,6 +270,7 @@ gst_modplug_init (GstModPlug *modplug)
modplug->buffer_in = NULL;
modplug->state = MODPLUG_STATE_NEED_TUNE;
+ GST_FLAG_SET (modplug, GST_ELEMENT_EVENT_AWARE);
}
static void
@@ -484,6 +485,7 @@ gst_modplug_fixate (GstPad *pad, const GstCaps *caps)
static void
gst_modplug_handle_event (GstModPlug *modplug)
{
+ gint64 value;
guint32 remaining;
GstEvent *event;
@@ -495,7 +497,16 @@ gst_modplug_handle_event (GstModPlug *modplug)
}
switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_EOS:
+ gst_event_unref (event);
+ break;
case GST_EVENT_DISCONTINUOUS:
+ if (gst_event_discont_get_value (event, GST_FORMAT_BYTES, &value)) {
+ if (remaining == value) {
+ gst_event_unref (event);
+ break;
+ }
+ }
gst_bytestream_flush_fast (modplug->bs, remaining);
default:
gst_pad_event_default (modplug->sinkpad, event);