gstreamer/gst-libs/gst
Garg 47e303269d audiobasesink: Fix deadlock caused by holding object lock while calling clock functions
Issue:
During a PAUSED->PLAYING transition when we are rendering an audio buffer in AudioBaseSink
we make adjustments to the sink's provided clock i.e. fix clock calibration using the external
pipeline clock, within "gst_audio_base_sink_sync_latency function inside gstaudiobasesink.c".
For the calibration adjustment we need to get the sink clock time using "gst_audio_clock_get_time".
But before calling "gst_audio_clock_get_time" we acquire the Object Lock on the Sink. If sink is
a pulsesink, "gst_audio_clock_get_time" internally calls "gst_pulsesink_get_time" which needs to
acquire Pulse Audio Main Loop Lock before querying Pulse Audio for its stream time using
"pa_stream_get_time". Please see "gst_pulsesink_get_time in pulsesink.c".

So the situation here is we have acquired the Object lock on Sink and need PA Main Loop Lock.
Now Pulse Audio Main Thread itself might be in the process of posting a stream status
message after Paused to Playing transition which in turn acquires the PA Main loop lock and
needs the Object Lock on Pulse Sink. This causes a deadlock with the earlier render thread.

Fix:
Do not acquire the object Lock on Sink before querying the time on PulseSink clock. This is
similar to the way we have used get_time at other places in the code. Acquire it after the
get_time call. This way PA Main loop will be able to post its stream status message by
acquiring the Sink Object lock and will eventually release its Main Loop lock needed for
gst_pulsesink_get_time to continue.

https://bugzilla.gnome.org/show_bug.cgi?id=736071
2014-09-12 14:21:19 +03:00
..
allocators dmabuf: Ensure _get_fd() works even for shared memory 2014-07-11 09:47:04 +02:00
app appsrc: Add push_sample() convenience function for easy appsink -> appsrc use 2014-09-12 14:07:49 +03:00
audio audiobasesink: Fix deadlock caused by holding object lock while calling clock functions 2014-09-12 14:21:19 +03:00
fft fft: Fix compiler errors caused by not including config.h 2013-03-02 19:13:39 +01:00
pbutils discoverer: Set 'processing = FALSE' when done discovering SYNC 2014-08-15 13:40:17 +02:00
riff riff: Recognize RF64 as RIFF file 2014-08-29 11:47:24 +03:00
rtp rtpbasepayload: Implement reconfigure event & renegotiation without subclass 2014-05-03 10:21:04 +02:00
rtsp rtspconnection: ignore timeout in session request header 2014-09-09 11:37:26 +02:00
sdp sdp: add gstmikey.h to sdp.h 2014-07-04 09:01:35 +01:00
tag libs: There is no G_TYPE_CHECK_INTERFACE_TYPE and G_TYPE_CHECK_INTERFACE_CAST 2014-06-26 16:18:46 +02:00
video videodecoder: Fix broken boolean expression 2014-08-28 17:06:22 +03:00
gettext.h Fix FSF address 2012-11-03 23:05:09 +00:00
glib-compat-private.h Fix FSF address 2012-11-03 23:05:09 +00:00
gst-i18n-app.h tools: add simple command-line gst-play utility for testing purposes 2013-08-16 15:45:23 +01:00
gst-i18n-plugin.h Fix FSF address 2012-11-03 23:05:09 +00:00
Makefile.am tools: add simple command-line gst-play utility for testing purposes 2013-08-16 15:45:23 +01:00