diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2005-07-01 21:00:02 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2005-07-01 21:00:02 +0000 |
| commit | 2724d0bb55298d5a3a66914bfd8d5b449090fc83 (patch) | |
| tree | 0f976a6e1172dd460d32e8174bd4738534115a49 /apps | |
| parent | c520d69f68b26ab3dc074b923071ff3fca6ef952 (diff) | |
| download | rockbox-2724d0bb55298d5a3a66914bfd8d5b449090fc83.zip rockbox-2724d0bb55298d5a3a66914bfd8d5b449090fc83.tar.gz rockbox-2724d0bb55298d5a3a66914bfd8d5b449090fc83.tar.bz2 rockbox-2724d0bb55298d5a3a66914bfd8d5b449090fc83.tar.xz | |
Pause correctly while seeking.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6975 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/playback.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/apps/playback.c b/apps/playback.c index c133e46..70cb363 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -470,6 +470,12 @@ static bool rebuffer_and_seek(int newpos) mutex_unlock(&mutex_bufferfill); + while (cur_ti->available == 0 && cur_ti->filerem > 0) { + yield(); + if (ci.stop_codec) + return false; + } + return true; } @@ -1415,10 +1421,21 @@ void audio_prev(void) void audio_ff_rewind(int newpos) { + int counter; + logf("rewind: %d", newpos); - /* Does not work yet. */ - if (playing) + /* Keep playback paused until seek is complete. */ + if (playing) { ci.seek_time = newpos+1; + counter = 30; + pcm_flush_audio(); + while (ci.seek_time) { + sleep(10); + if (counter-- == 0) + break ; + } + pcm_play_stop(); + } } void audio_flush_and_reload_tracks(void) |