Do not update resume information and do not log statistics when a

track is interrupted within the first 15 seconds.

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.

Initially contributed by Dave Slusher

Caveats:

* Works only for SWCODEC
* Skipping forward without altering the resume position does not work
  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.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29250 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Hohmuth 2011-02-08 20:31:27 +00:00
parent f0ce188681
commit 4844142e16
3 changed files with 18 additions and 3 deletions

View file

@ -2013,6 +2013,15 @@ static void audio_thread(void)
LOGFQUEUE("audio < Q_AUDIO_FF_REWIND"); LOGFQUEUE("audio < Q_AUDIO_FF_REWIND");
if (!playing) if (!playing)
break; 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) if (automatic_skip)
{ {
/* An automatic track skip is in progress. Finalize it, /* An automatic track skip is in progress. Finalize it,

View file

@ -722,10 +722,15 @@ static void tagtree_track_finish_event(void *data)
} }
tagcache_idx--; tagcache_idx--;
/* Don't process unplayed tracks. */ /* Don't process unplayed tracks, or tracks interrupted within the
if (id3->elapsed == 0) first 15 seconds. */
if (id3->elapsed == 0
#if CONFIG_CODEC == SWCODEC /* HWCODEC doesn't have automatic_skip */
|| (id3->elapsed < 15 * 1000 && !automatic_skip)
#endif
)
{ {
logf("not logging unplayed track"); logf("not logging unplayed or skipped track");
return; return;
} }

View file

@ -584,6 +584,7 @@ Ante Maretic
Benjamin Brown Benjamin Brown
Uwe Wiebach Uwe Wiebach
Mikhail Titov Mikhail Titov
Dave Slusher
The libmad team The libmad team
The wavpack team The wavpack team