gstsegment: Don't use g_return_val_if_fail()

Don't use g_return_val_if_fail() to catch the
open-ended segment or empty segment cases in
gst_segment_to_running_time_full()

g_return_val_if_fail() is for programmer errors,
and can be compiled out with a flag.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6275>
This commit is contained in:
Jan Schmidt 2024-02-25 04:26:21 +11:00 committed by Tim-Philipp Müller
parent c0fe3de2d7
commit 5e44b3b8e0

View file

@ -770,8 +770,8 @@ gst_segment_to_running_time_full (const GstSegment * segment, GstFormat format,
stop = segment->start + segment->duration;
/* cannot continue if no stop position set or invalid offset */
g_return_val_if_fail (stop != -1, 0);
g_return_val_if_fail (stop >= offset, 0);
if (stop == -1 || stop < offset)
return 0;
stop -= offset;