X-Git-Url: http://git.tdb.fi/?p=libs%2Fal.git;a=blobdiff_plain;f=source%2Fmp3decoder.cpp;h=00fc9181bd69a2a2d6318d7d13153c3a71fce363;hp=8ddad47032ee08eae3155ec133747773f9546726;hb=227da1e7a20432e056e7ab42444cb56f197c53d6;hpb=7961a6bc2a735d08a5d1ffeb6772ec3d545cb98c diff --git a/source/mp3decoder.cpp b/source/mp3decoder.cpp index 8ddad47..00fc918 100644 --- a/source/mp3decoder.cpp +++ b/source/mp3decoder.cpp @@ -55,7 +55,7 @@ Mp3Decoder::Mp3Decoder(IO::Seekable &io): try { decode_frame(); - format = (priv->frame.header.mode==MAD_MODE_SINGLE_CHANNEL ? MONO16 : STEREO16); + format = create_format(2, MAD_NCHANNELS(&priv->frame.header)); freq = priv->frame.header.samplerate; } catch(...) @@ -92,7 +92,7 @@ void Mp3Decoder::rewind() unsigned Mp3Decoder::read(char *buf, unsigned len) { - unsigned nchan = (format==STEREO16 ? 2 : 1); + unsigned nchan = get_n_channels(format); mad_pcm &pcm = priv->synth.pcm; unsigned pos = 0;