gstreamer/gst-libs/gst/audio
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
..
.gitignore Update .gitignore 2012-08-08 09:06:30 +01:00
audio-channels.c docs: doc fixes for audio library 2014-02-03 09:36:43 +01:00
audio-channels.h audio: make direct includes work again 2013-08-16 14:14:11 +01:00
audio-format.c audio: Add a missing precondition to gst_audio_format_from_string() 2014-05-28 11:34:01 +02:00
audio-format.h audio: make direct includes work again 2013-08-16 14:14:11 +01:00
audio-info.c audio: map channels=1,channel-mask=0 to MONO instead of NONE 2014-02-18 10:41:47 +00:00
audio-info.h audio: make direct includes work again 2013-08-16 14:14:11 +01:00
audio.c audiobase*: Drop trailing withespaces 2013-12-27 01:36:09 -03:00
audio.def add more plugins to the build add some definitions needed by plugins fixes for build problems 2004-07-26 22:09:59 +00:00
audio.h docs: fix some doc blocks 2013-09-09 15:52:05 +02:00
audio.vcproj more working plugins 2004-07-27 21:41:30 +00:00
audiofilter.vcproj more working plugins 2004-07-27 21:41:30 +00:00
gstaudiobasesink.c audiobasesink: Fix deadlock caused by holding object lock while calling clock functions 2014-09-12 14:21:19 +03:00
gstaudiobasesink.h audio: make direct includes work again 2013-08-16 14:14:11 +01:00
gstaudiobasesrc.c docs: remove outdated and pointless 'Last reviewed' lines from docs 2014-04-26 23:28:57 +01:00
gstaudiobasesrc.h audio: make direct includes work again 2013-08-16 14:14:11 +01:00
gstaudiocdsrc.c audiocdsrc: guard aginst overflow 2014-04-10 12:35:03 +01:00
gstaudiocdsrc.h audio: make direct includes work again 2013-08-16 14:14:11 +01:00
gstaudioclock.c docs: remove outdated and pointless 'Last reviewed' lines from docs 2014-04-26 23:28:57 +01:00
gstaudioclock.h audio: make direct includes work again 2013-08-16 14:14:11 +01:00
gstaudiodecoder.c audiodecoder: Fix broken boolean expression 2014-08-28 17:00:26 +03:00
gstaudiodecoder.h audiobase*: Drop trailing withespaces 2013-12-27 01:36:09 -03:00
gstaudioencoder.c audioencoder: Mark caps argument as not being transferred 2014-08-10 10:45:14 +01:00
gstaudioencoder.h audio: make direct includes work again 2013-08-16 14:14:11 +01:00
gstaudiofilter.c docs: remove outdated and pointless 'Last reviewed' lines from docs 2014-04-26 23:28:57 +01:00
gstaudiofilter.h audio: make direct includes work again 2013-08-16 14:14:11 +01:00
gstaudioiec61937.c audio: add support for AAC pass-through 2013-02-27 00:38:05 +00:00
gstaudioiec61937.h Fix FSF address 2012-11-03 23:05:09 +00:00
gstaudiometa.c docs: doc fixes for audio library 2014-02-03 09:36:43 +01:00
gstaudiometa.h audio: make direct includes work again 2013-08-16 14:14:11 +01:00
gstaudiopack-dist.c Release 1.3.1 2014-05-03 17:50:10 +02:00
gstaudiopack-dist.h audio: Update ORC dist files 2013-11-03 15:58:35 +01:00
gstaudiopack.orc audio-format: Use ORC for filling memory with silence samples 2013-11-03 15:58:35 +01:00
gstaudioringbuffer.c docs: remove outdated and pointless 'Last reviewed' lines from docs 2014-04-26 23:28:57 +01:00
gstaudioringbuffer.h audio: make direct includes work again 2013-08-16 14:14:11 +01:00
gstaudiosink.c docs: remove outdated and pointless 'Last reviewed' lines from docs 2014-04-26 23:28:57 +01:00
gstaudiosink.h audio: make direct includes work again 2013-08-16 14:14:11 +01:00
gstaudiosrc.c docs: remove outdated and pointless 'Last reviewed' lines from docs 2014-04-26 23:28:57 +01:00
gstaudiosrc.h audiosrc: Fix typo in docs 2014-02-09 11:28:48 +01:00
Makefile.am gst-libs: use GST_*_1_0 environment variables everywhere 2013-01-16 10:16:27 +00:00
streamvolume.c Fix FSF address 2012-11-03 23:05:09 +00:00
streamvolume.h libs: There is no G_TYPE_CHECK_INTERFACE_TYPE and G_TYPE_CHECK_INTERFACE_CAST 2014-06-26 16:18:46 +02:00
TODO gst-libs/gst/audio/TODO: Update TODO 2006-02-17 10:15:52 +00:00