GNOME Bugzilla – Bug 612223
[base(audio)sink] hangs in _wait_eos
Last modified: 2010-03-16 14:40:34 UTC
Consider some audio playback with a typical audio clock and ringbuffer. EOS arrives, which triggers draining and going into the loop in _wait_eos. Assume the thread is at that stage waiting on the clock for the proper render time. Then a state change to PAUSED happens, the clock wait is unscheduled and the _wait_eos loop waits for PLAYING. Then application changes state to PLAYING, and the _wait_eos resumes ... to wait_clock again for the right time. However, while state change to PLAYING performs gst_ring_buffer_may_start, the actual start is postponed to (e.g.) a ringbuffer commit. But since EOS has arrived, there will be no more _commit, so the ringbuffer does not advance, therefore clock time does not advance (though in PLAYING). So, the _wait_eos hangs.
Created attachment 155860 [details] [review] Arrange for a running clock for eos syncing Add some state variable to mark eos rendering and immediately start ringbuffer in PAUSED_TO_PLAYING if eos rendering in progress (rather than only _may_start).
Looks good IMHO but Wim might know a better solution ;)
At first sight, this is how I would do it as well.
I guess sufficient votes, so: commit dcc4b25686b7eb620bf5409d4ecca2c232dd70d0 Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Thu Mar 11 14:52:09 2010 +0100 baseaudiosink: arrange for a running ringbuffer/clock for _wait_eos Fixes #612223.