- added a dedicated player class for streamed music formats (i.e. MP3, Ogg and Flac)

The idea is to have more control on the game side instead of dealing with these formats in the backend, which was done for FMod because it already had the decoders implemented.
However, with OpenAL this setup makes no sense and only complicates future extensions that can be better handled at a higher level.
This commit is contained in:
Christoph Oelckers 2017-04-01 19:46:38 +02:00
commit dfd3535e02
11 changed files with 281 additions and 11 deletions

View file

@ -134,14 +134,14 @@ size_t MPG123Decoder::read(char *buffer, size_t bytes)
return amt;
}
bool MPG123Decoder::seek(size_t ms_offset)
bool MPG123Decoder::seek(size_t ms_offset, bool ms)
{
int enc, channels;
long srate;
if(mpg123_getformat(MPG123, &srate, &channels, &enc) == MPG123_OK)
{
size_t smp_offset = (size_t)((double)ms_offset / 1000. * srate);
size_t smp_offset = ms? (size_t)((double)ms_offset / 1000. * srate) : ms_offset;
if(mpg123_seek(MPG123, (off_t)smp_offset, SEEK_SET) >= 0)
{
Done = false;