summaryrefslogtreecommitdiffstats
path: root/apps/cuesheet.c
diff options
context:
space:
mode:
authorMichael Chicoine <mc2739@gmail.com>2010-01-06 14:48:42 +0000
committerMichael Chicoine <mc2739@gmail.com>2010-01-06 14:48:42 +0000
commit8e8e2627b27b28a855881db09f2c16bfb2193050 (patch)
tree9fd69d8f4a4030dc320cd2a625bf456b5f8fb862 /apps/cuesheet.c
parentf011fe2b5dfb21f6ec06c46eb979f3166a700e54 (diff)
downloadrockbox-8e8e2627b27b28a855881db09f2c16bfb2193050.tar.gz
rockbox-8e8e2627b27b28a855881db09f2c16bfb2193050.tar.bz2
rockbox-8e8e2627b27b28a855881db09f2c16bfb2193050.zip
FS#10856 - Skip to previous track inconsistent when using cuesheet
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24191 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/cuesheet.c')
-rw-r--r--apps/cuesheet.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c
index 7c631c72c8..ef1eff8a85 100644
--- a/apps/cuesheet.c
+++ b/apps/cuesheet.c
@@ -39,6 +39,7 @@
#include "plugin.h"
#include "playback.h"
#include "cuesheet.h"
+#include "gui/wps.h"
#define CUE_DIR ROCKBOX_DIR "/cue"
@@ -328,7 +329,18 @@ bool curr_cuesheet_skip(struct cuesheet *cue, int direction, unsigned long curr_
else
{
if (!(direction <= 0 && track == 0))
- track += direction;
+ {
+ /* If skipping forward, skip to next cuesheet segment. If skipping
+ backward before DEFAULT_SKIP_TRESH milliseconds have elapsed, skip
+ to previous cuesheet segment. If skipping backward after
+ DEFAULT_SKIP_TRESH seconds have elapsed, skip to the start of the
+ current cuesheet segment */
+ if (direction == 1 ||
+ ((curr_pos - cue->tracks[track].offset) < DEFAULT_SKIP_TRESH))
+ {
+ track += direction;
+ }
+ }
seek(cue->tracks[track].offset);
return true;