X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsounddecoder.cpp;h=e0a56d3a4fc1513d21e6b99eada7f26c262903db;hb=f89881a5da184ee9dc50123b34d3a2016c5cc8d5;hp=a2cd51af4624154cca52312157cfb18f31a9b21e;hpb=d035e638b940f25cb5d46a049a00b34dc60dc5e0;p=libs%2Fal.git diff --git a/source/sounddecoder.cpp b/source/sounddecoder.cpp index a2cd51a..e0a56d3 100644 --- a/source/sounddecoder.cpp +++ b/source/sounddecoder.cpp @@ -1,6 +1,7 @@ #include #include #include +#include "mp3decoder.h" #include "oggdecoder.h" #include "sounddecoder.h" @@ -39,9 +40,12 @@ SoundDecoder *SoundDecoder::open_io(IO::Seekable &io) { char sig_buf[8]; io.read(sig_buf, sizeof(sig_buf)); + io.seek(0, IO::S_BEG); string signature(sig_buf, sizeof(sig_buf)); if(OggDecoder::detect(signature)) return new OggDecoder(io); + else if(Mp3Decoder::detect(signature)) + return new Mp3Decoder(io); else { string sig_hex;