GNOME Bugzilla – Bug 696911
GstSegment adds lot of warning noise
Last modified: 2013-04-04 08:18:56 UTC
This patch http://cgit.freedesktop.org/gstreamer/gstreamer/commit/gst/gstsegment.c?id=82f7bdd7bbaf9d8e94f55186959b07d46a1e03e0 Now gst segment warns every time gst_segment_to_running_time is called with position outside of segment start/top. i.e. during seek - the position usually starts before the segment boundary as the seek goes to keyframe before segment start also basesink calls it with position=-1, gstcollectpads calls it with GST_BUFFER_DTS(buf) without checking if dts is valid. There are many places in gstreamer where the method is called with position outside of segment boundaries and I'm not sure why they all are now supposed to print warnings.
Example from gst_base_sink_get_sync_times ... /* set last stop position */ if (G_LIKELY (stop != GST_CLOCK_TIME_NONE && cstop != GST_CLOCK_TIME_NONE)) segment->position = cstop; else segment->position = cstart; do_times: rstart = gst_segment_to_running_time (segment, format, cstart); rstop = gst_segment_to_running_time (segment, format, cstop); ... it is valid that cstop = GST_CLOCK_TIME_NONE (hence the check) and basesink still calls gst_segment_to_running_time(segment, format, cstop), because it's harmless and just returns -1. But now it also prints a warning.
Actually the -1 is only harmless if you handle it. Currently there is few places where we endup having issues. There is an example at: https://bugzilla.gnome.org/show_bug.cgi?id=696899
The API docs clearly state that you will get -1 if you pass value outside segment boundaries. It doesn't mean that such value warrants a warning though. And if someone decides that it does, then the api docs need to be updated alongside with the rest of the gstreamer to make sure that nothing calls it with such position.
Btw, in my opinion perhaps it would be better to be able to have negative running time, as well as negative timestamps. https://bugzilla.gnome.org/show_bug.cgi?id=679466
commit 95c6cd37a87984f35aa8b9b15ec32d4202b4b6b6 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Thu Apr 4 10:17:30 2013 +0200 segment: don't WARN, just DEBUG Fixes https://bugzilla.gnome.org/show_bug.cgi?id=696911