- 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:
parent
4a0b3c3bab
commit
dfd3535e02
11 changed files with 281 additions and 11 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue