mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-17 22:32:51 +00:00
Bug 495558 - Initialize sydneyaudio/ALSA with host endian format (fixes sound on big endian machines). r=chris.double
--HG-- extra : rebase_source : d2635e23f0e65a7e9db397d54f998610fa2348f6
This commit is contained in:
parent
4d45703ece
commit
1ccbfca6b5
@ -19,6 +19,7 @@ sydney_os2_base.patch: Bug 448918 - add OS/2 support (this patch should
|
||||
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.
|
||||
|
44
media/libsydneyaudio/bug495558_alsa_endian.patch
Normal file
44
media/libsydneyaudio/bug495558_alsa_endian.patch
Normal file
@ -0,0 +1,44 @@
|
||||
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
|
||||
@@ -93,17 +93,17 @@ sa_stream_create_pcm(
|
||||
if (_s == NULL) {
|
||||
return SA_ERROR_INVALID;
|
||||
}
|
||||
*_s = NULL;
|
||||
|
||||
if (mode != SA_MODE_WRONLY) {
|
||||
return SA_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
- if (format != SA_PCM_FORMAT_S16_LE) {
|
||||
+ if (format != SA_PCM_FORMAT_S16_NE) {
|
||||
return SA_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate the instance and required resources.
|
||||
*/
|
||||
if ((s = malloc(sizeof(sa_stream_t))) == NULL) {
|
||||
return SA_ERROR_OOM;
|
||||
@@ -137,17 +137,21 @@ sa_stream_open(sa_stream_t *s) {
|
||||
if (snd_pcm_open(&s->output_unit,
|
||||
"default",
|
||||
SND_PCM_STREAM_PLAYBACK,
|
||||
0) < 0) {
|
||||
return SA_ERROR_NO_DEVICE;
|
||||
}
|
||||
|
||||
if (snd_pcm_set_params(s->output_unit,
|
||||
+#ifdef SA_LITTLE_ENDIAN
|
||||
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) {
|
||||
snd_pcm_close(s->output_unit);
|
||||
s->output_unit = NULL;
|
||||
return SA_ERROR_NOT_SUPPORTED;
|
@ -98,7 +98,7 @@ sa_stream_create_pcm(
|
||||
if (mode != SA_MODE_WRONLY) {
|
||||
return SA_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
if (format != SA_PCM_FORMAT_S16_LE) {
|
||||
if (format != SA_PCM_FORMAT_S16_NE) {
|
||||
return SA_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
@ -142,7 +142,11 @@ sa_stream_open(sa_stream_t *s) {
|
||||
}
|
||||
|
||||
if (snd_pcm_set_params(s->output_unit,
|
||||
#ifdef SA_LITTLE_ENDIAN
|
||||
SND_PCM_FORMAT_S16_LE,
|
||||
#else
|
||||
SND_PCM_FORMAT_S16_BE,
|
||||
#endif
|
||||
SND_PCM_ACCESS_RW_INTERLEAVED,
|
||||
s->n_channels,
|
||||
s->rate,
|
||||
|
@ -10,3 +10,4 @@ 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user