summaryrefslogtreecommitdiffstats
path: root/gst/goom
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2003-03-04 22:04:05 +0000
committerWim Taymans <wim.taymans@gmail.com>2003-03-04 22:04:05 +0000
commita92a4855427c41c92509ca328e0e3698ec6133db (patch)
treee4190da4a496da3977d029a659b82c187f8a4384 /gst/goom
parent2ce9feebb71583f0fd0a6cc8311b1311c537818a (diff)
resync on discont events
Original commit message from CVS: resync on discont events
Diffstat (limited to 'gst/goom')
-rw-r--r--gst/goom/gstgoom.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c
index 8af75570..9a75af8b 100644
--- a/gst/goom/gstgoom.c
+++ b/gst/goom/gstgoom.c
@@ -198,6 +198,8 @@ gst_goom_init (GstGOOM *goom)
gst_element_add_pad (GST_ELEMENT (goom), goom->sinkpad);
gst_element_add_pad (GST_ELEMENT (goom), goom->srcpad);
+ GST_FLAG_SET (goom, GST_ELEMENT_EVENT_AWARE);
+
gst_pad_set_chain_function (goom->sinkpad, gst_goom_chain);
gst_pad_set_link_function (goom->sinkpad, gst_goom_sinkconnect);
@@ -232,6 +234,25 @@ gst_goom_chain (GstPad *pad, GstBuffer *bufin)
GST_DEBUG (0, "GOOM: chainfunc called");
+ if (GST_IS_EVENT (bufin)) {
+ GstEvent *event = GST_EVENT (bufin);
+
+ switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_DISCONTINUOUS:
+ {
+ gint64 value = 0;
+
+ gst_event_discont_get_value (event, GST_FORMAT_TIME, &value);
+
+ goom->next_time = value;
+ }
+ default:
+ gst_pad_event_default (pad, event);
+ break;
+ }
+ return;
+ }
+
samples_in = GST_BUFFER_SIZE (bufin) / sizeof (gint16);
GST_DEBUG (0, "input buffer has %d samples", samples_in);