summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-08-06 05:50:14 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-08-06 05:50:14 +0000
commit095854b98925f5b01643b78f664dc4e6eace72be (patch)
tree7ca95e7f0232ff61195cda5fb06c080239440735
parent0812164adae4b8f8d40b1d1da8567cf92ab30b64 (diff)
downloadrockbox-095854b98925f5b01643b78f664dc4e6eace72be.zip
rockbox-095854b98925f5b01643b78f664dc4e6eace72be.tar.gz
rockbox-095854b98925f5b01643b78f664dc4e6eace72be.tar.bz2
rockbox-095854b98925f5b01643b78f664dc4e6eace72be.tar.xz
Put back the line (accidentally?) removed on the last commit. That is
necessary to prevent playback stuttering when fast skipping tracks. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7285 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playback.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/playback.c b/apps/playback.c
index c6c77fd..85f708f 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1283,6 +1283,7 @@ bool codec_request_next_track_callback(void)
if (tracks[track_ridx].filesize == 0) {
logf("Loading from disk...");
new_track = 0;
+ last_index = -1;
queue_post(&audio_queue, AUDIO_PLAY, 0);
return false;
}
@@ -1303,6 +1304,7 @@ bool codec_request_next_track_callback(void)
/*+ (off_t)tracks[track_ridx].codecsize*/ > codecbuflen) {
logf("Loading from disk...");
new_track = 0;
+ last_index = -1;
queue_post(&audio_queue, AUDIO_PLAY, 0);
return false;
}
@@ -1408,6 +1410,15 @@ void audio_thread(void)
queue_wait_w_tmo(&audio_queue, &ev, 0);
switch (ev.id) {
case AUDIO_PLAY:
+ /* Refuse to start playback if we are already playing
+ the requested track. This is needed because when skipping
+ tracks fast, AUDIO_PLAY commands will get queued with the
+ the same track and playback will stutter. */
+ if (last_index == playlist_get_display_index() && playing) {
+ logf("already playing req. track");
+ break ;
+ }
+
logf("starting...");
playing = true;
paused = false;