music_ogg.c: provide audio using the host endianness (bug #5187.) SDL-1.2
authorOzkan Sezer <sezeroz@gmail.com>
Sat, 27 Jun 2020 00:47:10 +0300
branchSDL-1.2
changeset 1131cb32312d98c2
parent 1128 f3ba2c5e2bef
child 1132 33b9d022472d
music_ogg.c: provide audio using the host endianness (bug #5187.)

backport from default/2.0 branch changeset e6f2d0a83df5, original
patch from Sergio Padrino.
music_ogg.c
     1.1 --- a/music_ogg.c	Sun Dec 29 17:00:10 2019 +0300
     1.2 +++ b/music_ogg.c	Sat Jun 27 00:47:10 2020 +0300
     1.3 @@ -133,7 +133,7 @@
     1.4  #ifdef OGG_USE_TREMOR
     1.5  	len = vorbis.ov_read(&music->vf, data, sizeof(data), &section);
     1.6  #else
     1.7 -	len = vorbis.ov_read(&music->vf, data, sizeof(data), 0, 2, 1, &section);
     1.8 +	len = vorbis.ov_read(&music->vf, data, sizeof(data), SDL_BYTEORDER == SDL_BIG_ENDIAN, 2, 1, &section);
     1.9  #endif
    1.10  	if ( len <= 0 ) {
    1.11  		if ( len == 0 ) {
    1.12 @@ -146,7 +146,7 @@
    1.13  		vorbis_info *vi;
    1.14  
    1.15  		vi = vorbis.ov_info(&music->vf, -1);
    1.16 -		SDL_BuildAudioCVT(cvt, AUDIO_S16, vi->channels, vi->rate,
    1.17 +		SDL_BuildAudioCVT(cvt, AUDIO_S16SYS, vi->channels, vi->rate,
    1.18  		                       mixer.format,mixer.channels,mixer.freq);
    1.19  		if ( cvt->buf ) {
    1.20  			SDL_free(cvt->buf);