diff options
author | Marcoen Hirschberg <marcoen@gmail.com> | 2008-06-28 17:55:53 +0000 |
---|---|---|
committer | Marcoen Hirschberg <marcoen@gmail.com> | 2008-06-28 17:55:53 +0000 |
commit | 2fb70bcabb1c871baf17ace7a82f9fda9ab721c6 (patch) | |
tree | 9047a029a90fd88805a09f5c85e1f8eb39de37c0 /apps/plugins/mpegplayer | |
parent | bcf9b5dfa6c575ac70271bdddf3ee7e5c1b0c9c6 (diff) | |
download | rockbox-2fb70bcabb1c871baf17ace7a82f9fda9ab721c6.tar.gz rockbox-2fb70bcabb1c871baf17ace7a82f9fda9ab721c6.zip |
implement smooth seeking acceleration for audio playback and mpegplayer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17843 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer')
-rw-r--r-- | apps/plugins/mpegplayer/mpegplayer.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 6d6aa2078f..5b478d0bf7 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c | |||
@@ -1109,8 +1109,7 @@ static int wvs_get_status(void) | |||
1109 | static uint32_t wvs_ff_rw(int btn, unsigned refresh) | 1109 | static uint32_t wvs_ff_rw(int btn, unsigned refresh) |
1110 | { | 1110 | { |
1111 | unsigned int step = TS_SECOND*rb->global_settings->ff_rewind_min_step; | 1111 | unsigned int step = TS_SECOND*rb->global_settings->ff_rewind_min_step; |
1112 | const long ff_rw_accel = rb->global_settings->ff_rewind_accel; | 1112 | const long ff_rw_accel = (rb->global_settings->ff_rewind_accel + 3); |
1113 | long accel_tick = *rb->current_tick + ff_rw_accel*HZ; | ||
1114 | uint32_t start; | 1113 | uint32_t start; |
1115 | uint32_t time = stream_get_seek_time(&start); | 1114 | uint32_t time = stream_get_seek_time(&start); |
1116 | const uint32_t duration = stream_get_duration(); | 1115 | const uint32_t duration = stream_get_duration(); |
@@ -1145,7 +1144,6 @@ static uint32_t wvs_ff_rw(int btn, unsigned refresh) | |||
1145 | 1144 | ||
1146 | while (1) | 1145 | while (1) |
1147 | { | 1146 | { |
1148 | long tick = *rb->current_tick; | ||
1149 | stream_keep_disk_active(); | 1147 | stream_keep_disk_active(); |
1150 | 1148 | ||
1151 | switch (btn) | 1149 | switch (btn) |
@@ -1199,10 +1197,8 @@ static uint32_t wvs_ff_rw(int btn, unsigned refresh) | |||
1199 | 1197 | ||
1200 | ff_rw_count += step; | 1198 | ff_rw_count += step; |
1201 | 1199 | ||
1202 | if (ff_rw_accel != 0 && TIME_AFTER(tick, accel_tick)) { | 1200 | /* smooth seeking by multiplying step by: 1 + (2 ^ -accel) */ |
1203 | step *= 2; | 1201 | step += step >> ff_rw_accel; |
1204 | accel_tick = tick + ff_rw_accel*HZ; | ||
1205 | } | ||
1206 | 1202 | ||
1207 | if (wvs.status == WVS_STATUS_FF) { | 1203 | if (wvs.status == WVS_STATUS_FF) { |
1208 | if (duration - time <= ff_rw_count) | 1204 | if (duration - time <= ff_rw_count) |