From 176b8ffbfffb39d0d340e3e5f19f1081884523d7 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Thu, 31 Mar 2011 13:25:00 +0200 Subject: [PATCH] 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. --- ext/pulse/pulsesink.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c index 5a60cda..79c5ea8 100644 --- a/ext/pulse/pulsesink.c +++ b/ext/pulse/pulsesink.c @@ -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; -- 2.7.4