diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-06-10 21:42:20 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-06-10 21:42:20 +0000 |
commit | 43255a7f63af65d88bbead4c0d6429ef2008ada8 (patch) | |
tree | eab9001afffd5a0e0e4a4ce064ab43fc510e2176 /src/playlist.c | |
parent | 3b1efb55883a2382d6971f947767a02b1ee28ea2 (diff) | |
download | mpd-43255a7f63af65d88bbead4c0d6429ef2008ada8.tar.gz mpd-43255a7f63af65d88bbead4c0d6429ef2008ada8.tar.xz mpd-43255a7f63af65d88bbead4c0d6429ef2008ada8.zip |
since stuff like vorbis streams report actual time into stream,
not time played, for previous add a hack where we record the difference
in time between previous presses
git-svn-id: https://svn.musicpd.org/mpd/trunk@1440 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/playlist.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/playlist.c b/src/playlist.c index 31dc31fc5..a18f85dee 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -1165,14 +1165,16 @@ int setPlaylistRandomStatus(FILE * fp, int status) { } int previousSongInPlaylist(FILE * fp) { + static time_t lastTime = 0; + time_t diff = time(NULL) - lastTime; + + lastTime += diff; + if(playlist_state!=PLAYLIST_STATE_PLAY) return 0; syncPlaylistWithQueue(0); - if (getPlayerElapsedTime()>PLAYLIST_PREV_UNLESS_ELAPSED && - playlist.songs[playlist.order[playlist.current]]->type - != SONG_TYPE_URL) - { + if (diff && getPlayerElapsedTime() > PLAYLIST_PREV_UNLESS_ELAPSED) { return playPlaylistOrderNumber(fp,playlist.current); } else { |