Skip to content

Commit

Permalink
rm .nst, any_quick -> any
Browse files Browse the repository at this point in the history
If we load with dumb_read_any_quick, seeking is broken in DUMB 2.0 but
works in 2.0.0~20 (20 commits ago behind 2.0.0). If we load with
dumb_read_any, it works in both DUMB 2.0 and 2.0.0~20.

I have no clue why this is, and I will investigate. I assume it's from
our bad 64-bit conversion of the DUMB API that silently broke inside DUMB.
  • Loading branch information
SimonN committed Sep 27, 2017
1 parent 910a81b commit f8cc830
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions addons/acodec/acodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ bool al_init_acodec_addon(void)
#if (DUMB_MAJOR_VERSION) >= 2
/*
* DUMB 2.0 offers a single loader for at least 13 formats, see their
* readme. The .nst format is not listed there, but Amiga NoiseTracker
* is supported nonetheless. It merely has no common extensions, see:
* readme. Amiga NoiseTracker isn't listed there, but it's DUMB-supported.
* It merely has no common extensions, see:
* https://github.com/kode54/dumb/issues/53
*/
ret &= al_register_audio_stream_loader(".669", _al_load_dumb_audio_stream);
Expand All @@ -60,8 +60,6 @@ bool al_init_acodec_addon(void)
ret &= al_register_audio_stream_loader_f(".mod", _al_load_dumb_audio_stream_f);
ret &= al_register_audio_stream_loader(".mtm", _al_load_dumb_audio_stream);
ret &= al_register_audio_stream_loader_f(".mtm", _al_load_dumb_audio_stream_f);
ret &= al_register_audio_stream_loader(".nst", _al_load_dumb_audio_stream);
ret &= al_register_audio_stream_loader_f(".nst", _al_load_dumb_audio_stream_f);
ret &= al_register_audio_stream_loader(".okt", _al_load_dumb_audio_stream);
ret &= al_register_audio_stream_loader_f(".okt", _al_load_dumb_audio_stream_f);
ret &= al_register_audio_stream_loader(".psm", _al_load_dumb_audio_stream);
Expand Down
6 changes: 3 additions & 3 deletions addons/acodec/modaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static struct
int, int, float, float, long, void *); /* deprecated */
void (*register_dumbfile_system)(const DUMBFILE_SYSTEM *);
DUMBFILE *(*dumbfile_open_ex)(void *, const DUMBFILE_SYSTEM *);
DUH *(*dumb_read_any_quick)(DUMBFILE *, int, int);
DUH *(*dumb_read_any)(DUMBFILE *, int, int);
#else
long (*duh_render)(DUH_SIGRENDERER *,
int, int, float, float, long, void *);
Expand Down Expand Up @@ -268,7 +268,7 @@ static ALLEGRO_AUDIO_STREAM *modaudio_stream_init(ALLEGRO_FILE* f,
* The second int, subsong, matters only for very few formats.
* A5 doesn't allow to choose a subsong from the 5.2 API anyway, thus 0.
*/
duh = lib.dumb_read_any_quick(df, 0, 0);
duh = lib.dumb_read_any(df, 0, 0);
#else
duh = loader(df);
#endif
Expand Down Expand Up @@ -400,7 +400,7 @@ static bool init_libdumb(void)
dfs.close = dfs_close;

#if (DUMB_MAJOR_VERSION) >= 2
INITSYM(dumb_read_any_quick);
INITSYM(dumb_read_any);

dfs.seek = dfs_seek;
dfs.get_size = dfs_get_size;
Expand Down

0 comments on commit f8cc830

Please sign in to comment.