use BIGENDIAN for ov_read, instead of changing endianness unneccessarily
git-svn-id: https://svn.musicpd.org/mpd/trunk@232 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
@@ -31,6 +31,12 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <vorbis/vorbisfile.h>
|
#include <vorbis/vorbisfile.h>
|
||||||
|
|
||||||
|
#ifdef WORDS_BIGENDIAN
|
||||||
|
#define OGG_DECODE_USE_BIGENDIAN 1
|
||||||
|
#else
|
||||||
|
#define OGG_DECODE_USE_BIGENDIAN 0
|
||||||
|
#endif
|
||||||
|
|
||||||
int ogg_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc)
|
int ogg_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc)
|
||||||
{
|
{
|
||||||
OggVorbis_File vf;
|
OggVorbis_File vf;
|
||||||
@@ -77,7 +83,8 @@ int ogg_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc)
|
|||||||
}
|
}
|
||||||
ret = ov_read(&vf,chunk+chunkpos,
|
ret = ov_read(&vf,chunk+chunkpos,
|
||||||
CHUNK_SIZE-chunkpos,
|
CHUNK_SIZE-chunkpos,
|
||||||
0,2,1,
|
OGG_DECODE_USE_BIGENDIAN,
|
||||||
|
2,1,
|
||||||
¤t_section);
|
¤t_section);
|
||||||
if(ret<=0) eof = 1;
|
if(ret<=0) eof = 1;
|
||||||
else chunkpos+=ret;
|
else chunkpos+=ret;
|
||||||
@@ -89,10 +96,6 @@ int ogg_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc)
|
|||||||
}
|
}
|
||||||
if(dc->stop) break;
|
if(dc->stop) break;
|
||||||
else if(dc->seek) continue;
|
else if(dc->seek) continue;
|
||||||
#ifdef WORDS_BIGENDIAN
|
|
||||||
pcm_changeBufferEndianness(chunk,CHUNK_SIZE,
|
|
||||||
af->bits);
|
|
||||||
#endif
|
|
||||||
memcpy(cb->chunks+cb->end*CHUNK_SIZE,
|
memcpy(cb->chunks+cb->end*CHUNK_SIZE,
|
||||||
chunk,chunkpos);
|
chunk,chunkpos);
|
||||||
cb->chunkSize[cb->end] = chunkpos;
|
cb->chunkSize[cb->end] = chunkpos;
|
||||||
|
Reference in New Issue
Block a user