summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2007-03-31 06:49:49 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2007-03-31 06:49:49 +0000
commitce35f76a53f89216a3bbcb6c8049885c66bfbcce (patch)
treeb0e48ea0db4f0e177649b67f951b386871e6888c
parent1088f695a26563a589db736dccc403f0cb284354 (diff)
downloadrockbox-ce35f76a53f89216a3bbcb6c8049885c66bfbcce.tar.gz
rockbox-ce35f76a53f89216a3bbcb6c8049885c66bfbcce.zip
Don't update runtime info when stopping playback, except when playlist ends. Fixes wrong playcounts and autoscores being generated.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12976 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playback.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/apps/playback.c b/apps/playback.c
index be0d476ebd..3aacde09c3 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -2081,8 +2081,8 @@ static void codec_thread(void)
if (!codec_load_next_track())
{
- // queue_post(&codec_queue, Q_AUDIO_STOP, 0);
LOGFQUEUE("codec > audio Q_AUDIO_STOP");
+ /* End of playlist */
queue_post(&audio_queue, Q_AUDIO_STOP, 0);
break;
}
@@ -2101,6 +2101,7 @@ static void codec_thread(void)
sleep(1);
}
LOGFQUEUE("codec > audio Q_AUDIO_STOP");
+ /* End of playlist */
queue_post(&audio_queue, Q_AUDIO_STOP, 0);
break;
}
@@ -3296,11 +3297,17 @@ static void audio_stop_playback(void)
playlist_update_resume_info(
(playlist_end && ci.stop_codec)?NULL:audio_current_track());
- /* inc index so runtime info is saved in audio_clear_track_entries() */
- /* done here, as audio_stop_playback() may be called more than once */
- track_ridx++;
- track_ridx &= MAX_TRACK_MASK;
-
+ /* Increment index so runtime info is saved in audio_clear_track_entries().
+ * Done here, as audio_stop_playback() may be called more than once.
+ * Don't update runtime unless playback is stopped because of end of playlist.
+ * Updating runtime when manually stopping a tracks, can destroy autoscores
+ * and playcounts.
+ */
+ if (playlist_end)
+ {
+ track_ridx++;
+ track_ridx &= MAX_TRACK_MASK;
+ }
}
filling = false;