GNOME Bugzilla – Bug 726709
playback-test: Segment seeks do not work anymore
Last modified: 2015-05-29 11:36:42 UTC
I can't get loop playback working on any file using playback-test (the loop checkbox). Then I also tested that with an old test of mine, and could not get this to work either. There seems to be a regression somewhere.
I use seeks with SEGMENT flag in buzztrax and there it works just fine. When using playback-test it does indeed not work though. This comes up in the warning-level 0:00:14.893876710 13349 0x156c800 WARN playbin gstplaybin2.c:1962:gst_play_bin_set_current_audio_stream:<playbin> can't switch audio, the stream combiner's sink pads don't have the "active-pad" property
I've now reverted all the way back to 1.0 core and -base, and it still does not loop at the end. I'm wondering if it ever worked. When is your old test of yours from, Nicolas ? Pre 1.0 ?
Last time it worked for me (and I didn't have time to fix it for all demuxers) it was during the hackfest in Milano in 2013. I don't remember if it worked in the playback-test or just my own. I have re-done some test recently, and it worked there, do you need me to share ?
I just tried again with the latest git, and the way I'm testing it does not work: ./tests/examples/playback/playback-test 0 file:///path/to/file Enable the "loop" option and press play. I tried with a FLAC file and a MP3 file. In both cases, playback reaches the end and does not loop. How did you test a working example ?
There's also tests/icles/test-segment-seeks in gst-plugins-good. That one seems to work more or less, but there are weird artifacts. Also changing it to repeat things, e.g. with start = start + SEGMENT_DURATION / 2;, seems to work except for artifacts. (Testing this with MP4) OTOH non-flushing seeks in general seem to be broken. Just doing them in playback-test causes playback to stop until you do a flushing seek again. So I think what is broken here is not segment seeks... but non-flushing seeks. And really there is not much you can potentially do wrong with segment seeks vs non-segment seeks inside demuxers, and at least in qtdemux that looks absolutely correct. While non-flushing seeks require more work, and can easily cause things to go wrong because of miscalculations inside the segments.
I just tried with playback-test, work "sometimes" with MOV, but fails with Matroska. I concluded it's not entirely playback-test fault even though it forgets to seek (hence update) from time to time. Let me attach that example I was playing with.
The artefacts I saw were because of gst-libav. Commenting out all lines in avviddec that flush the buffers made it work without artefacts. So also something to look at. Then the gst-plugins-good example also fails completely on mewmew, which might be related to subtitles or matroska. On MP4 the example works, it also works if you play [0,1],[0.5,1.5],[1,2],[1.5,2.5], etc... or [0,5], [5, 10], [5, 10], [5, 10], ... But non-flushing seeks in playback-test are still broken on exactly the same file.
Created attachment 300912 [details] Test looping over a part of a file This is also an experiment to fade audio with segment boundary, you can forget about this part. Over MOV it works for me (in master).
I pushed some changes in core, base and good (for the icles thing) related to this. For me the icles thing works now on the files I tested, including Matroska. Only remaining problem here is that avviddec seems to flush too much from its buffers, so there are always artefacts :) Not flushing the buffers however causes old ones to come out of nowhere and causes crashes every now and then.
Not sure how the "loop" thing in the playback-test app should work at all. The only thing it seems to do is to set the SEGMENT seek flag... which is a bit pointless without being able to set a stop position.
Ah nevermind, it just starts again from the beginning after receiving SEGMENT_DONE. Makes sense and works here now Only thing that is completely broken is non-flushing seeks in other situations.
And this here fixes non-flushing seeks in general in qtdemux: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=bf95f93c0189aa04f18e264b86b6527e431c5d53 Worked fine Matroska before already.
Nicolas, anything else necessary to be done here? It all seems to work fine for me with MP4 and Matroska.
I guess that it's for now. I think it's fine to backport bf95f93 to 1.4 branch.