Skip to content
Snippets Groups Projects
Commit d941f137 authored by dos's avatar dos Committed by pippin
Browse files

audio_mp3: Implement seek to beginning

parent ba2654a9
No related branches found
No related tags found
No related merge requests found
Pipeline #8166 passed
...@@ -141,6 +141,16 @@ static void mp3_draw(st3m_media *media, Ctx *ctx) { ...@@ -141,6 +141,16 @@ static void mp3_draw(st3m_media *media, Ctx *ctx) {
static void mp3_think(st3m_media *media, float ms_elapsed) { static void mp3_think(st3m_media *media, float ms_elapsed) {
mp3_state *self = (void *)media; mp3_state *self = (void *)media;
if (self->file && self->control.seek == 0) {
rewind(self->file);
self->offset = 0;
self->pos = 0;
self->control.time = 0;
self->control.position = 0;
self->control.seek = -1;
mp3dec_init(&self->mp3d);
}
mp3_fetch_data(self); mp3_fetch_data(self);
self->scroll_pos += ms_elapsed / 1000.0; self->scroll_pos += ms_elapsed / 1000.0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment