forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 2
/
bug495558_alsa_endian.patch
44 lines (41 loc) · 1.36 KB
/
bug495558_alsa_endian.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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;