diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-10-20 17:12:29 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-12-02 19:03:35 +0100 |
commit | 8412c2a656c37d194d42e52774f9729c531f47b2 (patch) | |
tree | f5f14c7a89582e1c406f923993b7f9b5234966c0 | |
parent | 0ff0e6a4349506bd275b4ec7a05371a1e18a6163 (diff) |
segment: move g_return_if_fail to where it is needed
-rw-r--r-- | gst/gstsegment.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gst/gstsegment.c b/gst/gstsegment.c index c1527c0f0..5b10a913d 100644 --- a/gst/gstsegment.c +++ b/gst/gstsegment.c @@ -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; |