dvdspu: Make GAP event aware
authorJan Schmidt <thaytan@noraisin.net>
Fri, 31 Aug 2012 19:31:48 +0000 (12:31 -0700)
committerJan Schmidt <thaytan@noraisin.net>
Fri, 31 Aug 2012 20:12:41 +0000 (13:12 -0700)
gst/dvdspu/gstdvdspu.c

index 5d7b5262207a28604977eb09b491b1dd24403193..0eb84f38bbe15f66595ae5750baf7e38ccf29a93 100644 (file)
@@ -1117,6 +1117,22 @@ gst_dvd_spu_subpic_event (GstPad * pad, GstObject * parent, GstEvent * event)
       gst_event_unref (event);
       break;
     }
+    case GST_EVENT_GAP:
+    {
+      GstClockTime timestamp, duration;
+      gst_event_parse_gap (event, &timestamp, &duration);
+      if (GST_CLOCK_TIME_IS_VALID (duration))
+        timestamp += duration;
+
+      DVD_SPU_LOCK (dvdspu);
+      dvdspu->subp_seg.position = timestamp;
+      GST_LOG_OBJECT (dvdspu, "Received GAP. Segment now: %" GST_SEGMENT_FORMAT,
+          &dvdspu->subp_seg);
+      DVD_SPU_UNLOCK (dvdspu);
+
+      gst_event_unref (event);
+      break;
+    }
     case GST_EVENT_FLUSH_START:
       gst_event_unref (event);
       goto done;