audio/alsa: Exit write loop if underlying device is already paused.
authorDoug Nazar <nazard@nazar.ca>
Wed, 7 Apr 2021 08:25:47 +0000 (04:25 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 8 Apr 2021 07:28:21 +0000 (07:28 +0000)
commit1d5ad7d1da8afc410550c7c1b3f46dbebd029576
treeae91e62f5a0e5bfda160f1dff223a66760c2ef36
parentf38d2d3820e3177df61d62686c570025b2445444
audio/alsa: Exit write loop if underlying device is already paused.

If the alsasink thread starts the write loop but another thread pauses
the underlying alsa device, the sink thread will endlessly loop.

snd_pcm_writei() will return 0 if the state is SND_PCM_STATE_PAUSED
and the loop will never make any progress.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1097>
ext/alsa/gstalsasink.c
gst-libs/gst/audio/gstaudiosink.c