diff options
author | Max Horn | 2004-02-22 14:11:16 +0000 |
---|---|---|
committer | Max Horn | 2004-02-22 14:11:16 +0000 |
commit | aa6ec62e9db78db12912d0e48025241c5d7ef4f7 (patch) | |
tree | 0afae2b795f07b9bd1c00dc75af3dca3864dac5f /sound/mp3.cpp | |
parent | 6db3a8819e7ef847f6aefac8e40f542cad006481 (diff) | |
download | scummvm-rg350-aa6ec62e9db78db12912d0e48025241c5d7ef4f7.tar.gz scummvm-rg350-aa6ec62e9db78db12912d0e48025241c5d7ef4f7.tar.bz2 scummvm-rg350-aa6ec62e9db78db12912d0e48025241c5d7ef4f7.zip |
Patch #885904 (Flac Support) with some tweaks by me
svn-id: r12984
Diffstat (limited to 'sound/mp3.cpp')
-rw-r--r-- | sound/mp3.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/sound/mp3.cpp b/sound/mp3.cpp index 556a43cdb3..27938b7aa0 100644 --- a/sound/mp3.cpp +++ b/sound/mp3.cpp @@ -261,7 +261,7 @@ int MP3InputStream::readBuffer(int16 *buffer, const int numSamples) { return samples; } -AudioStream *makeMP3Stream(File *file, uint size) { +AudioStream *makeMP3Stream(File *file, uint32 size) { return new MP3InputStream(file, mad_timer_zero, size); } @@ -385,8 +385,21 @@ MP3TrackInfo::~MP3TrackInfo() { _file->close(); } -DigitalTrackInfo *makeMP3TrackInfo(File *file) { - return new MP3TrackInfo(file); +DigitalTrackInfo *getMP3Track(int track) { + char track_name[32]; + File *file = new File(); + + sprintf(track_name, "track%d.mp3", track); + file->open(track_name); + + if (file->isOpen()) { + MP3TrackInfo *trackInfo = new MP3TrackInfo(file); + if (!trackInfo->error()) + return trackInfo; + delete trackInfo; + } + delete file; + return NULL; } |