After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 519878 - [basesink] Superfluous critical warning on segment format mismatches.
[basesink] Superfluous critical warning on segment format mismatches.
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.36
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-02 12:03 UTC by Mark Nauwelaerts
Modified: 2011-07-04 12:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Possible patch. (474 bytes, patch)
2008-03-02 12:20 UTC, Mark Nauwelaerts
none Details | Review
possible patch (1.31 KB, patch)
2008-03-03 15:00 UTC, Wim Taymans
none Details | Review
Fix avimux generated segment format warning (664 bytes, patch)
2008-05-13 20:26 UTC, Mark Nauwelaerts
committed Details | Review

Description Mark Nauwelaerts 2008-03-02 12:03:01 UTC
[hm, bit long story for a short item ...]

Consider (a.o.) a fragment as follows
... ! muxer ! filesink
muxer will presumably send buffers that may or may not have valid timestamps
(buffers with media content versus some container format buffers).
At EOS time, it will likely send a BYTE based NEW_SEGMENT to have filesink perform seeking, which may be the first NEW_SEGMENT to arrive there (e.g. avimux).  This triggers a set_new_segment_full, which then g_return_if_fail because the basesink's segment is then already set to TIME format (strangely enough).

The latter behaviour has been introduced in response to bug 494245, by forcing the running/stream time calculations to occur in TIME format.
Both gst_segment_to_stream_time/running_time have the side-effect to change the segment's format to the given (TIME) one, if it is presently UNDEFINED and the input timestamp is valid.

So, the segment gets into TIME format (with no real added value) along the way, and complains later on about the received BYTE segment.
Comment 1 Mark Nauwelaerts 2008-03-02 12:20:27 UTC
Created attachment 106377 [details] [review]
Possible patch.

* If gst_base_sink_get_sync_times decides no do_sync, do not bother to calculate times (with possible side-effects).

In particular, (a.o.) filesink NULL'ifies get_times; does not want to sync.

Of course, these lines (or variations thereof) could be shifted around a bit.
There may be other approaches altogether, such as fixing (several?) other elements, e.g. assuring a BYTE based segment gets sent first (which may be what the critical warning is meant to point out in the first place :) ).

Anyway, these few lines (or alike) seem to make sense.
Comment 2 Wim Taymans 2008-03-03 11:20:47 UTC
This is unfortunate. We can't sync on the clock for muxers that operate in byte formats (we could have if the seek would have happened with a seek event in bytes).

Of course the muxer should send a bytes segment first before pushing buffers. It should do this only when it wants to perform a seek later on. This also tiggers the fact that any following element won't be able to sync, which is ok since this would usually be done for sending the data over a network (like UDP), which is pointless for formats that modify the header at the end.

I'm tempted to even always skip the sync code if the format is not TIME.
Comment 3 Wim Taymans 2008-03-03 15:00:58 UTC
Created attachment 106473 [details] [review]
possible patch

This patch disables all segment operations such as clipping and sync when the sink element received a bytes newsegment.
Comment 4 Mark Nauwelaerts 2008-05-13 20:26:02 UTC
Created attachment 110874 [details] [review]
Fix avimux generated segment format warning 

As mentioned above, muxer should sent BYTE segment first if it expects to do seeking later on.  This makes avimux do so.
Comment 5 Wim Taymans 2008-10-13 13:55:38 UTC
what's up with this?
Comment 6 Tobias Mueller 2009-04-22 21:02:28 UTC
Hey guys, This bug has been set to NEEDINFO for quite some time now. Any chance that we can resolve this one soonish?
Comment 7 Sebastian Dröge (slomo) 2009-09-10 08:31:04 UTC
I guess Wim's patch can be committed now... Wim? Otherwise lets close this bug if there's nothing to fix here.
Comment 8 Wim Taymans 2009-09-10 08:56:18 UTC
I think this is going to break some stuff
Comment 9 Tobias Mueller 2010-03-01 20:08:58 UTC
Well. Can the reported issue be identified as a bug worth fixing? If so, we should consider setting this to NEW. If not, let's close this one.
Comment 10 Tobias Mueller 2010-05-03 18:16:44 UTC
Reopening as I can't see any open non developer question.
Comment 11 Sebastian Dröge (slomo) 2011-05-19 07:00:06 UTC
Ok, so what now? Can we get Wim's patch in 0.11 at least?
Comment 12 Mark Nauwelaerts 2011-07-04 12:05:50 UTC
AFAICS, the original report should not occur anymore now;
* either since muxers probably take care to send some intial BYTE newsegment.  
* basesink code should not trigger format problems if one does not