aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2005-02-02 04:32:55 +0000
committerWarren Dukes <warren.dukes@gmail.com>2005-02-02 04:32:55 +0000
commit2debf9924ae3761451a2d8496756a4bdfef390c8 (patch)
treec2e7cec67724fa0362b1ce2d1744098257d50c8d /src
parent9f29915f7766656b9aac44267f592d625b758b83 (diff)
downloadmpd-2debf9924ae3761451a2d8496756a4bdfef390c8.tar.gz
mpd-2debf9924ae3761451a2d8496756a4bdfef390c8.tar.xz
mpd-2debf9924ae3761451a2d8496756a4bdfef390c8.zip
big endian support for flac
git-svn-id: https://svn.musicpd.org/mpd/trunk@2929 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src')
-rw-r--r--src/inputPlugins/flac_plugin.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/inputPlugins/flac_plugin.c b/src/inputPlugins/flac_plugin.c
index 57addbd10..11453c51c 100644
--- a/src/inputPlugins/flac_plugin.c
+++ b/src/inputPlugins/flac_plugin.c
@@ -401,7 +401,7 @@ FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__SeekableStreamDecoder *dec,
int c_chan;
float timeChange;
FLAC__uint64 newPosition = 0;
- int bytesPerSample = data->dc->audioFormat.bits/8;
+ const int bytesPerSample = data->dc->audioFormat.bits/8;
timeChange = ((float)samples)/frame->header.sample_rate;
data->time+= timeChange;
@@ -415,9 +415,16 @@ FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__SeekableStreamDecoder *dec,
for(c_samp = 0; c_samp < frame->header.blocksize; c_samp++) {
for(c_chan = 0; c_chan < frame->header.channels; c_chan++) {
+#ifdef WORDS_BIGENDIAN
+ memcpy(data->chunk+data->chunk_length,
+ &buf[c_chan][c_samp]+4-bytesPerSample,
+ bytesPerSample);
+ data->chunk_length+=bytesPerSample;
+#else
memcpy(data->chunk+data->chunk_length,
&buf[c_chan][c_samp], bytesPerSample);
data->chunk_length+=bytesPerSample;
+#endif
if(FLAC_CHUNK_SIZE-data->chunk_length < bytesPerSample)
{
if(flacSendChunk(data)<0) {