GNOME Bugzilla – Bug 603471
[flacdec] not timestamping output buffers
Last modified: 2010-01-06 13:23:21 UTC
Hi, when creating an Ogg/FLAC file with oggmux like this: gst-launch-0.10 audiotestsrc num-buffers=1000 ! flacenc ! oggmux ! filesink location=test-flac.ogg Playback works fine but seeking is completely broken with latest GIT while in 0.10.25 it worked.
flac code is not so nice anymore.. lots of stuff with granulepos and conversions between samples and time. I guess the oggdemux rewrite broke this fragile piece of code.
It looks like flacdec isn't timestamping outgoing buffers here.
There's a bit of a procedural problem here as well: either we release core, base and -good together (with a fixed flacdec), or the new oggdemux needs to work with the old flacdec as well. I think the problem is just that flacdec assumes that only timestamps OR buffer end offsets are set, and assumes the absence/presence of one implies the presence/absence of the other. Removing the code that uses dec->cur_granulepos makes it work fine again. Another issue/regression is that the new oggdemux doesn't handle the 'nonstandard' flac-in-ogg mapping properly (ie. does not detect it leading to errors).
I just fixed the old-style fLaC. It sounds like we can work around this by preventing oggdemux from putting timestamps on flac streams until the next release. Not pretty, though.
(In reply to comment #4) > I just fixed the old-style fLaC. > > It sounds like we can work around this by preventing oggdemux from putting > timestamps on flac streams until the next release. Not pretty, though. ...and making flacdec work with and without timestamps for the next -good release? Can't we just get a new -good release done with just the flacdec change? :) Also, does the same problem apply to Speex and CELT?
(In reply to comment #5) > (In reply to comment #4) > > I just fixed the old-style fLaC. > > > > It sounds like we can work around this by preventing oggdemux from putting > > timestamps on flac streams until the next release. Not pretty, though. > > > ...and making flacdec work with and without timestamps for the next -good > release? Can't we just get a new -good release done with just the flacdec > change? :) > > Also, does the same problem apply to Speex and CELT? Probably, at least seeking is broken with CELT and the CELT elements are based on the Speex elements (at least the timestamp/granulepos handling).
On the one hand, some testing suggests that flac ogg files (as produced by pipeline given above) do play and even allow for seeking (maybe due to intermediate oggdemux fixes?). On the other hand, as mentioned earlier, current flacdec is not timestamping outgoing buffers. That is basically a bug in flacdec (not so much a regression) since it does not seem to do so either in e.g. matroskademux case. [apparently, it 'just works' because newsegment events do make it through, so basesink just renders based on that without further syncing] The following commit should take care of the latter (as mentioned above, flac code could do with some more cleanup, but will likely get to that a bit later on): commit a76af918d0d2a4c391e84be525efb7834c75ad26 Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Wed Jan 6 14:06:14 2010 +0100 flacdec: really use upstream timestamp if there is one See/fixes #603471.