summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStepan Moskovchenko <stevenm@rockbox.org>2007-11-03 06:31:33 +0000
committerStepan Moskovchenko <stevenm@rockbox.org>2007-11-03 06:31:33 +0000
commit3be1ca028117344ac0967fbe9379793a891f36eb (patch)
treec149fe049a29ec8144b9a480762ec880f654cc5a
parent11a3661d73884f627c804fbcc0e5be820511cbfa (diff)
downloadrockbox-3be1ca028117344ac0967fbe9379793a891f36eb.tar.gz
rockbox-3be1ca028117344ac0967fbe9379793a891f36eb.zip
MIDI: Improve seeking (especially near the end of the file) by disabling playback during the seek. Next
step is to prevent delta value calculation during seeking, and just recompute the current deltas once seeking is over. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15426 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/midi/midiplay.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/plugins/midi/midiplay.c b/apps/plugins/midi/midiplay.c
index e1710e8eac..c69c8b1ad6 100644
--- a/apps/plugins/midi/midiplay.c
+++ b/apps/plugins/midi/midiplay.c
@@ -316,6 +316,7 @@ static int midimain(void * filename)
{
/* Rewinding is tricky. Basically start the file over */
/* but run through the tracks without the synth running */
+ rb->pcm_play_stop();
int desiredTime = playingTime - 5; /* Rewind 5 sec */
@@ -357,6 +358,7 @@ static int midimain(void * filename)
while(playingTime < desiredTime)
tick();
+ rb->pcm_play_data(&get_more, NULL, 0);
break;
}
@@ -370,8 +372,12 @@ static int midimain(void * filename)
/* Have the issue where numberOfSamples changes within this tick */
int tickCount = samp / numberOfSamples;
int a=0;
+
+ rb->pcm_play_stop();
+
for(a=0; a<tickCount; a++)
tick();
+ rb->pcm_play_data(&get_more, NULL, 0);
break;
}