aboutsummaryrefslogtreecommitdiffstats
path: root/src/inputPlugins/audiofile_plugin.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-08-24 21:59:19 +0000
committerEric Wong <normalperson@yhbt.net>2006-08-24 21:59:19 +0000
commit64a4c635de97bf4b2c83e8a1b205b063501107f0 (patch)
treeee4206a20910e1b263447e4afb4ca50614b87920 /src/inputPlugins/audiofile_plugin.c
parentb8fe818ae744e3656c7f235b23e6bfccf7494d59 (diff)
downloadmpd-64a4c635de97bf4b2c83e8a1b205b063501107f0.tar.gz
mpd-64a4c635de97bf4b2c83e8a1b205b063501107f0.tar.xz
mpd-64a4c635de97bf4b2c83e8a1b205b063501107f0.zip
audiofile_plugin: use afSetVirtualSampleFormat, too
This finally fixes a bug from over two years ago playing a wave file (oprah.wav) with the following characteristics (from sfinfo): File Format Microsoft RIFF WAVE Format (wave) Data Format 8-bit integer (unsigned, little endian) Audio Data 986827 bytes begins at offset 58 (3a hex) 1 channel, 986827 frames Sampling Rate 22050.00 Hz Duration 44.754 seconds Of course, this has been regression tested with all the files that the previous commit got working. Thanks to Michael Pruett (audiofile author) for the hint and shame on me for forgetting about it for over two years :x git-svn-id: https://svn.musicpd.org/mpd/trunk@4682 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/audiofile_plugin.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/inputPlugins/audiofile_plugin.c b/src/inputPlugins/audiofile_plugin.c
index 31c835b8f..91dc9ea07 100644
--- a/src/inputPlugins/audiofile_plugin.c
+++ b/src/inputPlugins/audiofile_plugin.c
@@ -70,6 +70,8 @@ static int audiofile_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
return -1;
}
+ afSetVirtualSampleFormat(af_fp, AF_DEFAULT_TRACK,
+ AF_SAMPFMT_TWOSCOMP, 16);
afGetVirtualSampleFormat(af_fp, AF_DEFAULT_TRACK, &fs, &bits);
dc->audioFormat.bits = bits;
dc->audioFormat.sampleRate = afGetRate(af_fp, AF_DEFAULT_TRACK);