segment: move g_return_if_fail to where it is needed

This commit is contained in:
Wim Taymans 2010-10-20 17:12:29 +02:00
parent 0ff0e6a434
commit 8412c2a656

View file

@ -555,12 +555,12 @@ gst_segment_to_stream_time (GstSegment * segment, GstFormat format,
gint64 result, start, stop, time;
gdouble abs_applied_rate;
g_return_val_if_fail (segment != NULL, -1);
/* format does not matter for -1 */
if (G_UNLIKELY (position == -1))
return -1;
g_return_val_if_fail (segment != NULL, -1);
if (G_UNLIKELY (segment->format == GST_FORMAT_UNDEFINED))
segment->format = format;
@ -641,11 +641,11 @@ gst_segment_to_running_time (GstSegment * segment, GstFormat format,
gint64 result;
gint64 start, stop, accum;
g_return_val_if_fail (segment != NULL, -1);
if (G_UNLIKELY (position == -1))
return -1;
g_return_val_if_fail (segment != NULL, -1);
if (G_UNLIKELY (segment->format == GST_FORMAT_UNDEFINED))
segment->format = format;