Bug 526411 - Reduce requested audio latency in sydneyaudio ALSA backend to avoid playback deadlock. r=chris.double
authorMatthew Gregan <kinetik@flim.org>
Mon, 08 Feb 2010 12:29:43 +1300
changeset 37972 8c84037f3ad92ad28785e63211077161c9ba2732
parent 37971 872dcf34dab3cb4d4c68486dd24ffc5b6f6c5fec
child 37973 b76ad6cdd76efb50f512a5fc13c5aecf0ac68092
push idunknown
push userunknown
push dateunknown
reviewerschris.double
bugs526411
milestone1.9.3a2pre
Bug 526411 - Reduce requested audio latency in sydneyaudio ALSA backend to avoid playback deadlock. r=chris.double
media/libsydneyaudio/README_MOZILLA
media/libsydneyaudio/bug526411_latency.patch
media/libsydneyaudio/src/sydney_audio_alsa.c
media/libsydneyaudio/update.sh
--- a/media/libsydneyaudio/README_MOZILLA
+++ b/media/libsydneyaudio/README_MOZILLA
@@ -18,8 +18,10 @@ sydney_os2_base.patch: Bug 448918 - add 
 
 sydney_os2_moz.patch:  Bug 448918 - add Mozilla-specific code to
                        sydney_audio_os2.c
 
 bug495794_closeAudio.patch fixes a crash when destroying the sa_stream_t after
 a failed attempt to open the stream.
 
 bug495558_alsa_endian.patch adds support for big endian ALSA platforms.
+
+bug526411_latency.patch: reduce requested latency to 250ms to match OGGPLAY_AUDIO_OFFSET.
new file mode 100644
--- /dev/null
+++ b/media/libsydneyaudio/bug526411_latency.patch
@@ -0,0 +1,22 @@
+diff --git a/media/libsydneyaudio/src/sydney_audio_alsa.c b/media/libsydneyaudio/src/sydney_audio_alsa.c
+--- a/media/libsydneyaudio/src/sydney_audio_alsa.c
++++ b/media/libsydneyaudio/src/sydney_audio_alsa.c
+@@ -138,17 +138,17 @@ sa_stream_open(sa_stream_t *s) {
+                          SND_PCM_FORMAT_S16_LE,
+ #else
+                          SND_PCM_FORMAT_S16_BE,
+ #endif
+                          SND_PCM_ACCESS_RW_INTERLEAVED,
+                          s->n_channels,
+                          s->rate,
+                          1,
+-                         500000) < 0) {
++                         250000) < 0) {
+     snd_pcm_close(s->output_unit);
+     s->output_unit = NULL;
+     return SA_ERROR_NOT_SUPPORTED;
+   }
+   
+   return SA_SUCCESS;
+ }
+ 
--- a/media/libsydneyaudio/src/sydney_audio_alsa.c
+++ b/media/libsydneyaudio/src/sydney_audio_alsa.c
@@ -138,17 +138,17 @@ sa_stream_open(sa_stream_t *s) {
                          SND_PCM_FORMAT_S16_LE,
 #else
                          SND_PCM_FORMAT_S16_BE,
 #endif
                          SND_PCM_ACCESS_RW_INTERLEAVED,
                          s->n_channels,
                          s->rate,
                          1,
-                         500000) < 0) {
+                         250000) < 0) {
     snd_pcm_close(s->output_unit);
     s->output_unit = NULL;
     return SA_ERROR_NOT_SUPPORTED;
   }
   
   return SA_SUCCESS;
 }
 
--- a/media/libsydneyaudio/update.sh
+++ b/media/libsydneyaudio/update.sh
@@ -6,8 +6,9 @@ cp $1/include/sydney_audio.h include/syd
 cp $1/src/*.c src/
 cp $1/AUTHORS ./AUTHORS
 patch -p4 <pause-resume.patch
 patch -p4 <include-CoreServices.patch
 patch -p4 <sydney_os2_base.patch
 patch -p4 <sydney_os2_moz.patch
 patch -p3 <bug495794_closeAudio.patch
 patch -p3 < bug495558_alsa_endian.patch
+patch -p3 <bug526411_latency.patch