Skip to content

Commit

Permalink
Use regular seeking for Ogg streams.
Browse files Browse the repository at this point in the history
The old one did cross-fades, causing unexpected behavior in certain
cases.

Fixes liballeg#1310
  • Loading branch information
SiegeLordEx authored and SiegeLord committed Apr 2, 2022
1 parent e8457df commit 15e4353
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions addons/acodec/ogg.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static struct
#ifndef TREMOR
int (*ov_open_callbacks)(void *, OggVorbis_File *, const char *, long, ov_callbacks);
double (*ov_time_total)(OggVorbis_File *, int);
int (*ov_time_seek_lap)(OggVorbis_File *, double);
int (*ov_time_seek)(OggVorbis_File *, double);
double (*ov_time_tell)(OggVorbis_File *);
long (*ov_read)(OggVorbis_File *, char *, int, int, int, int, int *);
#else
Expand Down Expand Up @@ -119,17 +119,10 @@ static bool init_dynlib(void)
INITSYM(ov_open_callbacks);
INITSYM(ov_pcm_total);
INITSYM(ov_info);
#ifndef TREMOR
INITSYM(ov_time_total);
INITSYM(ov_time_seek_lap);
INITSYM(ov_time_tell);
INITSYM(ov_read);
#else
INITSYM(ov_time_total);
INITSYM(ov_time_seek);
INITSYM(ov_time_tell);
INITSYM(ov_read);
#endif

return true;

Expand Down Expand Up @@ -312,7 +305,7 @@ static bool ogg_stream_seek(ALLEGRO_AUDIO_STREAM *stream, double time)
if (time >= extra->loop_end)
return false;
#ifndef TREMOR
return (lib.ov_time_seek_lap(extra->vf, time) != -1);
return (lib.ov_time_seek(extra->vf, time) != -1);
#else
return lib.ov_time_seek(extra->vf, time*1000) != -1;
#endif
Expand Down

0 comments on commit 15e4353

Please sign in to comment.