gst/gstevent.c: Add some assert and docs for invalid input to the qos function.

Original commit message from CVS:
* gst/gstevent.c: (gst_event_new_qos):
Add some assert and docs for invalid input to the qos function.
This commit is contained in:
Wim Taymans 2008-06-04 11:31:15 +00:00
parent a866e9d33b
commit 0fff6fa810
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2008-06-04 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/gstevent.c: (gst_event_new_qos):
Add some assert and docs for invalid input to the qos function.
2008-05-30 Wim Taymans <wim.taymans@collabora.co.uk>
* libs/gst/base/gstbasesink.c: (gst_base_sink_get_sync_times),

View file

@ -757,7 +757,8 @@ gst_event_parse_buffer_size (GstEvent * event, GstFormat * format,
* The upstream element can use the @diff and @timestamp values to decide
* whether to process more buffers. For possitive @diff, all buffers with
* timestamp <= @timestamp + @diff will certainly arrive late in the sink
* as well.
* as well. A (negative) @diff value so that @timestamp + @diff would yield a
* result smaller than 0 is not allowed.
*
* The application can use general event probes to intercept the QoS
* event and implement custom application specific QoS handling.
@ -768,6 +769,9 @@ GstEvent *
gst_event_new_qos (gdouble proportion, GstClockTimeDiff diff,
GstClockTime timestamp)
{
/* diff must be positive or timestamp + diff must be positive */
g_return_val_if_fail (diff >= 0 || -diff <= timestamp, NULL);
GST_CAT_INFO (GST_CAT_EVENT,
"creating qos proportion %lf, diff %" G_GINT64_FORMAT
", timestamp %" GST_TIME_FORMAT, proportion,