[0.11] gstreamer: event: require a valid duration for the GAP event

Tim Müller tpm at kemper.freedesktop.org
Sat Jan 28 10:51:15 PST 2012


Module: gstreamer
Branch: 0.11
Commit: 51f6f5addfbe02afedb9d1d69661aac467bb305a
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=51f6f5addfbe02afedb9d1d69661aac467bb305a

Author: Tim-Philipp Müller <tim.muller at collabora.co.uk>
Date:   Sat Jan 28 18:50:23 2012 +0000

event: require a valid duration for the GAP event

---

 gst/gstevent.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/gst/gstevent.c b/gst/gstevent.c
index f5418b3..ae25a5b 100644
--- a/gst/gstevent.c
+++ b/gst/gstevent.c
@@ -567,8 +567,8 @@ gst_event_new_eos (void)
 
 /**
  * gst_event_new_gap:
- * @timestamp: the start time (pts) of a gap
- * @duration: the duration of the gap, or %GST_CLOCK_TIME_NONE
+ * @timestamp: the start time (pts) of the gap
+ * @duration: the duration of the gap
  *
  * Create a new GAP event. A gap event can be thought of as conceptually
  * equivalent to a buffer to signal that there is no data for a certain
@@ -584,12 +584,12 @@ gst_event_new_gap (GstClockTime timestamp, GstClockTime duration)
   GstEvent *event;
 
   g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), NULL);
+  g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (duration), NULL);
 
   GST_CAT_TRACE (GST_CAT_EVENT, "creating gap %" GST_TIME_FORMAT " - "
       "%" GST_TIME_FORMAT " (duration: %" GST_TIME_FORMAT ")",
-      GST_TIME_ARGS (timestamp),
-      GST_TIME_ARGS (GST_CLOCK_TIME_IS_VALID (duration) ? (timestamp +
-              duration) : GST_CLOCK_TIME_NONE), GST_TIME_ARGS (duration));
+      GST_TIME_ARGS (timestamp), GST_TIME_ARGS (timestamp + duration),
+      GST_TIME_ARGS (duration));
 
   event = gst_event_new_custom (GST_EVENT_GAP,
       gst_structure_new_id (GST_QUARK (EVENT_GAP),
@@ -601,7 +601,8 @@ gst_event_new_gap (GstClockTime timestamp, GstClockTime duration)
 
 /**
  * gst_event_parse_gap:
- * @timestamp: (out): location where to store the start time (pts) of the gap
+ * @timestamp: (out) (allow-none): location where to store the
+ *     start time (pts) of the gap, or %NULL
  * @duration: (out) (allow-none): location where to store the duration of
  *     the gap, or %NULL
  *



More information about the gstreamer-commits mailing list