gstreamer/sys
Sebastian Dröge c842df1c3d opensles: Work around race condition in Android < 4.2 that leads to deadlocks on shutdown
We need to sleep a bit before destroying the player object
because of a bug in Android in versions < 4.2.

OpenSLES is using AudioTrack for rendering the sound. AudioTrack
has a thread that pulls raw audio from the buffer queue and then
passes it forward to AudioFlinger (AudioTrack::processAudioBuffer()).
This thread is calling various callbacks on events, e.g. when
an underrun happens or to request data. OpenSLES sets this callback
on AudioTrack (audioTrack_callBack_pullFromBuffQueue() from
android_AudioPlayer.cpp). Among other things this is taking a lock
on the player interface.

Now if we destroy the player interface object, it will first of all
take the player interface lock (IObject_Destroy()). Then it destroys
the audio player instance (android_audioPlayer_destroy()) which then
calls stop() on the AudioTrack and deletes it. Now the destructor of
AudioTrack will wait until the rendering thread (AudioTrack::processAudioBuffer())
has finished.

If all this happens with bad timing it can happen that the rendering
thread is currently e.g. handling underrun but did not lock the player
interface object yet. Then destroying happens and takes the lock and waits
for the thread to finish. Then the thread tries to take the lock and waits
forever.

We wait a bit before destroying the player object to make sure that
the rendering thread finished whatever it was doing, and then stops
(note: we called gst_opensles_ringbuffer_stop() before this already).
2014-05-16 09:10:48 +02:00
..
acmenc gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
acmmp3dec gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
androidmedia amcaudiodec: Calculate number of samples per frame for MP3 and use that 2014-02-14 12:51:50 +01:00
applemedia avfassetsrc: downgrade rank to SECONDARY in OS X 2014-04-24 12:28:17 +02:00
applemedia-nonpublic applemedia: Fix libtool usage 2014-02-06 16:17:39 +01:00
avc gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
bluez bluez: fix property names 2014-05-14 11:48:47 +02:00
cdrom gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
d3dvideosink d3dvideosink: post proper error message when window disappears 2014-04-08 17:52:12 +01:00
decklink decklink: Don't fail if HW does not have all interfaces 2014-04-27 09:34:39 -04:00
directdraw directdrawsink: update window width/height when it's not done in WndProc 2013-05-24 09:39:10 +02:00
directsound directsoundsrc: Fix critical due to missing debug category initialization 2014-04-08 13:39:22 +02:00
dshowdecwrapper gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
dshowsrcwrapper dshowaudiosrc: fix audiocapture producing silence 2013-06-18 12:04:58 +02:00
dshowvideosink Fix FSF address 2012-11-04 00:09:59 +00:00
dvb dvbsrc: Don't free string we're still using 2014-05-12 10:04:16 +02:00
dxr3 gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
fbdev gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
linsys gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
opensles opensles: Work around race condition in Android < 4.2 that leads to deadlocks on shutdown 2014-05-16 09:10:48 +02:00
osxvideo gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
pvr2d gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
qcam gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
qtwrapper qtwrapper: g_memmove() is deprecated 2013-11-21 15:54:32 +00:00
shm shm: Don't leak GstShmPipe 2014-05-13 11:41:42 +02:00
uvch264 uvch264src: Fix unitialized variable compiler warnings 2014-02-08 18:54:58 +01:00
vcd gst: Add better support for static plugins 2013-04-15 15:59:22 +02:00
vdpau vdpau: Fix comparison compiler warning 2014-02-08 18:56:06 +01:00
wasapi wasapisrc: Port to GstAudioSrc 2013-04-23 18:57:04 +02:00
wininet wininet: "iradio-mode" property defaults to TRUE 2014-03-05 20:28:04 +01:00
winks winks: port to 1.0 2014-03-15 15:34:29 +01:00
winscreencap winscreencap: Initial port to 1.0 2013-06-20 23:00:59 +02:00
Makefile.am mfc: Remove mfc plugin, it is obsoleted by the v4l2videodec element from gst-plugins-good 2014-05-03 13:12:40 +02:00