aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/AudiofileDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-03 21:00:50 +0200
committerMax Kellermann <max@duempel.org>2013-08-03 21:37:56 +0200
commitd1e7b4e38136f9342aad76c685a13adf0e69f869 (patch)
tree49643b937ddfe735511b566a71398da5a945d7aa /src/decoder/AudiofileDecoderPlugin.cxx
parent67f591a9ce60651da41afc499bd9a22e25314e35 (diff)
downloadmpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.gz
mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.xz
mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.zip
audio_format: convert to C++
Diffstat (limited to '')
-rw-r--r--src/decoder/AudiofileDecoderPlugin.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/decoder/AudiofileDecoderPlugin.cxx b/src/decoder/AudiofileDecoderPlugin.cxx
index b77c41d02..9c00b20ce 100644
--- a/src/decoder/AudiofileDecoderPlugin.cxx
+++ b/src/decoder/AudiofileDecoderPlugin.cxx
@@ -114,27 +114,27 @@ setup_virtual_fops(struct input_stream *stream)
return vf;
}
-static enum sample_format
+static SampleFormat
audiofile_bits_to_sample_format(int bits)
{
switch (bits) {
case 8:
- return SAMPLE_FORMAT_S8;
+ return SampleFormat::S8;
case 16:
- return SAMPLE_FORMAT_S16;
+ return SampleFormat::S16;
case 24:
- return SAMPLE_FORMAT_S24_P32;
+ return SampleFormat::S24_P32;
case 32:
- return SAMPLE_FORMAT_S32;
+ return SampleFormat::S32;
}
- return SAMPLE_FORMAT_UNDEFINED;
+ return SampleFormat::UNDEFINED;
}
-static enum sample_format
+static SampleFormat
audiofile_setup_sample_format(AFfilehandle af_fp)
{
int fs, bits;
@@ -160,7 +160,7 @@ audiofile_stream_decode(struct decoder *decoder, struct input_stream *is)
AFvirtualfile *vf;
int fs, frame_count;
AFfilehandle af_fp;
- struct audio_format audio_format;
+ AudioFormat audio_format;
float total_time;
uint16_t bit_rate;
int ret;
@@ -180,7 +180,7 @@ audiofile_stream_decode(struct decoder *decoder, struct input_stream *is)
return;
}
- if (!audio_format_init_checked(&audio_format,
+ if (!audio_format_init_checked(audio_format,
afGetRate(af_fp, AF_DEFAULT_TRACK),
audiofile_setup_sample_format(af_fp),
afGetVirtualChannels(af_fp, AF_DEFAULT_TRACK),
@@ -199,7 +199,7 @@ audiofile_stream_decode(struct decoder *decoder, struct input_stream *is)
fs = (int)afGetVirtualFrameSize(af_fp, AF_DEFAULT_TRACK, 1);
- decoder_initialized(decoder, &audio_format, true, total_time);
+ decoder_initialized(decoder, audio_format, true, total_time);
do {
ret = afReadFrames(af_fp, AF_DEFAULT_TRACK, chunk,