pulsesink: also uncork during EOS waiting (and after EOS is rendered)

Pulsesink was recently changed to defer uncorking until there is data
to write. This condition will however never occur when EOS in being
rendered (since that marks the end of data). Changing to PAUSED state
while EOS is being waited on results in a hang: pausing corks the
stream, which will never be undone since there is no more data when
going back to PLAYING. If pulsesink is the clock provider, deadlock
ensues since time doesn't continue in corked state and the clock id
for EOS wait never fires.

Fixes #645961.
This commit is contained in:
Mark Nauwelaerts 2011-03-31 13:25:00 +02:00
parent 9f256d81db
commit 176b8ffbff

View file

@ -1081,6 +1081,13 @@ gst_pulseringbuffer_start (GstRingBuffer * buf)
GST_DEBUG_OBJECT (psink, "starting");
pbuf->paused = FALSE;
/* EOS needs running clock */
if (GST_BASE_SINK_CAST (psink)->eos ||
g_atomic_int_get (&GST_BASE_AUDIO_SINK (psink)->abidata.
ABI.eos_rendering))
gst_pulsering_set_corked (pbuf, FALSE, FALSE);
pa_threaded_mainloop_unlock (mainloop);
return TRUE;