Do not update resume information when track playback ends within the first 15 seconds of the track. Regard a rewind to 0:00 as a track restart (updating resume position / playback statistics before the rewind and starting the 15 s delay). This allows skipping forward across an unplayed track without changing its resume offset. Also, it is possible to skip backward to the previous track after rewinding to the current track to 0:00 (pressing Left twice) without losing the current track's resume position. TODO: * Skipping forward without altering the resume position does not work yet when skip to outro has been turned on. * The 15-second window in which the resume offset will not be updated should start at the initial resume position, not at 0:00. This would allow skipping over partially played tracks without altering the resume position. --- apps/playback.c | 9 +++++++++ apps/tagtree.c | 4 +++- 2 files changed, 12 insertions(+), 1 deletions(-) diff --git a/apps/playback.c b/apps/playback.c index e71e06b..e33a4ac 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -2013,6 +2013,15 @@ static void audio_thread(void) LOGFQUEUE("audio < Q_AUDIO_FF_REWIND"); if (!playing) break; + + if ((long)ev.data == 0) + { + /* About to restart the track - send track finish + events if not already done. */ + if (thistrack_id3 == audio_current_track()) + send_event(PLAYBACK_EVENT_TRACK_FINISH, thistrack_id3); + } + if (automatic_skip) { /* An automatic track skip is in progress. Finalize it, diff --git a/apps/tagtree.c b/apps/tagtree.c index 4673af3..6fcb2fc 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -758,7 +758,9 @@ static void tagtree_track_finish_event(void *data) } #if CONFIG_CODEC == SWCODEC - if (global_settings.autoresume_enable) + if (global_settings.autoresume_enable + /* do not update resume info when manually skipping across a track */ + && (automatic_skip || (id3->elapsed >= 15UL * 1000UL))) { unsigned long offset = automatic_skip ? 0 : id3->offset; -- 1.7.1