aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-08-24 20:54:40 +0000
committerEric Wong <normalperson@yhbt.net>2006-08-24 20:54:40 +0000
commitb8fe818ae744e3656c7f235b23e6bfccf7494d59 (patch)
treea565ab31d9cdfcfabc49fb7690f18563b7940ff0 /src
parentc81f4e2c048e8e9053a2ea1573a9fc3a70c3a9b8 (diff)
downloadmpd-b8fe818ae744e3656c7f235b23e6bfccf7494d59.tar.gz
mpd-b8fe818ae744e3656c7f235b23e6bfccf7494d59.tar.xz
mpd-b8fe818ae744e3656c7f235b23e6bfccf7494d59.zip
audiofile_plugin: fix for playing mono .au files with 8000Hz sample rate
Use the 'Virtual' variants of afGetSampleFormat, afGetChannels, afGetVirtualFrameSize in the audiofile library, since it already does the necessary abstraction for us. Of course, I've regression tested these changes against my standard 44100Hz/2ch/16bit wave files and they continue to play fine. Files tested: english.au (Linus Torvalds pronouncing 'Linux' in English) B01.Red_Bright_Heart.au (Chinese opera, sounds correct to me even though I don't actually understand the words) git-svn-id: https://svn.musicpd.org/mpd/trunk@4681 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/inputPlugins/audiofile_plugin.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/inputPlugins/audiofile_plugin.c b/src/inputPlugins/audiofile_plugin.c
index adec604ae..31c835b8f 100644
--- a/src/inputPlugins/audiofile_plugin.c
+++ b/src/inputPlugins/audiofile_plugin.c
@@ -70,10 +70,10 @@ static int audiofile_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
return -1;
}
- afGetSampleFormat(af_fp, AF_DEFAULT_TRACK, &fs, &bits);
+ afGetVirtualSampleFormat(af_fp, AF_DEFAULT_TRACK, &fs, &bits);
dc->audioFormat.bits = bits;
dc->audioFormat.sampleRate = afGetRate(af_fp, AF_DEFAULT_TRACK);
- dc->audioFormat.channels = afGetChannels(af_fp, AF_DEFAULT_TRACK);
+ dc->audioFormat.channels = afGetVirtualChannels(af_fp, AF_DEFAULT_TRACK);
getOutputAudioFormat(&(dc->audioFormat), &(cb->audioFormat));
frame_count = afGetFrameCount(af_fp, AF_DEFAULT_TRACK);
@@ -90,7 +90,7 @@ static int audiofile_decode(OutputBuffer * cb, DecoderControl * dc, char *path)
return -1;
}
- fs = (int)afGetFrameSize(af_fp, AF_DEFAULT_TRACK, 1);
+ fs = (int)afGetVirtualFrameSize(af_fp, AF_DEFAULT_TRACK, 1);
dc->state = DECODE_STATE_DECODE;
{