pjs/media/libsydneyaudio/bug495558_alsa_endian.patch

45 строки
1.4 KiB
Diff

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;