adder: only accept seek-types none and set
authorStefan Kost <ensonic@users.sf.net>
Sun, 18 Apr 2010 17:46:37 +0000 (20:46 +0300)
committerStefan Kost <ensonic@users.sf.net>
Fri, 30 Apr 2010 06:24:14 +0000 (09:24 +0300)
Previously we were also acting on cur and end, but treating them like none.

gst/adder/gstadder.c

index cdf9648..d5b7466 100644 (file)
@@ -706,6 +706,19 @@ gst_adder_src_event (GstPad * pad, GstEvent * event)
       gst_event_parse_seek (event, &adder->segment_rate, NULL, &flags, &curtype,
           &cur, &endtype, &end);
 
+      if ((curtype != GST_SEEK_TYPE_NONE) && (curtype != GST_SEEK_TYPE_SET)) {
+        result = FALSE;
+        GST_DEBUG_OBJECT (adder,
+            "seeking failed, unhandled seek type for start: %d", curtype);
+        goto done;
+      }
+      if ((endtype != GST_SEEK_TYPE_NONE) && (endtype != GST_SEEK_TYPE_SET)) {
+        result = FALSE;
+        GST_DEBUG_OBJECT (adder,
+            "seeking failed, unhandled seek type for end: %d", endtype);
+        goto done;
+      }
+
       flush = (flags & GST_SEEK_FLAG_FLUSH) == GST_SEEK_FLAG_FLUSH;
 
       /* check if we are flushing */
@@ -773,6 +786,8 @@ gst_adder_src_event (GstPad * pad, GstEvent * event)
       result = forward_event (adder, event, FALSE);
       break;
   }
+
+done:
   gst_object_unref (adder);
 
   return result;