From: <wt...@fr...> - 2005-05-25 11:58:15
|
CVS Root: /cvs/gstreamer Module: gst-plugins-base Changes by: wtay Date: Wed May 25 2005 04:57:57 PDT Log message: * ext/alsa/gstalsasink.c: (gst_alsasink_open): Open non-blocking, set to blocking mode afterwards to avoid lockups when audio device is busy. Modified files: . : ChangeLog ext/alsa : gstalsasink.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ChangeLog.diff?r1=1.1710&r2=1.1711 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-base/ext/alsa/gstalsasink.c.diff?r1=1.41&r2=1.42 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-base/ChangeLog,v retrieving revision 1.1710 retrieving revision 1.1711 diff -u -d -r1.1710 -r1.1711 --- ChangeLog 23 May 2005 18:07:27 -0000 1.1710 +++ ChangeLog 25 May 2005 11:57:45 -0000 1.1711 @@ -1,3 +1,9 @@ +2005-05-25 Wim Taymans <wi...@fl...> + + * ext/alsa/gstalsasink.c: (gst_alsasink_open): + Open non-blocking, set to blocking mode afterwards to avoid + lockups when audio device is busy. 2005-05-23 Ronald S. Bultje <rb...@ro...> * gst-libs/gst/audio/gstringbuffer.c: (gst_ringbuffer_clear): Index: gstalsasink.c RCS file: /cvs/gstreamer/gst-plugins-base/ext/alsa/gstalsasink.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- gstalsasink.c 5 May 2005 15:06:36 -0000 1.41 +++ gstalsasink.c 25 May 2005 11:57:45 -0000 1.42 @@ -429,8 +429,10 @@ if (!alsasink_parse_spec (alsa, spec)) goto spec_parse; - CHECK (snd_pcm_open (&alsa->handle, alsa->device, SND_PCM_STREAM_PLAYBACK, 0), - open_error); + CHECK (snd_pcm_open (&alsa->handle, alsa->device, SND_PCM_STREAM_PLAYBACK, + SND_PCM_NONBLOCK), open_error); + CHECK (snd_pcm_nonblock (alsa->handle, 0), non_block); CHECK (set_hwparams (alsa), hw_params_failed); CHECK (set_swparams (alsa), sw_params_failed); @@ -459,6 +461,12 @@ ("Playback open error: %s", snd_strerror (err)), (NULL)); return FALSE; } +non_block: + { + GST_ELEMENT_ERROR (alsa, RESOURCE, OPEN_READ, + ("Could not set device to blocking: %s", snd_strerror (err)), (NULL)); + return FALSE; + } hw_params_failed: { GST_ELEMENT_ERROR (alsa, RESOURCE, OPEN_READ, |