Commit 0fff6fa8 authored by Wim Taymans's avatar Wim Taymans

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.
parent a866e9d3
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),
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment