summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-11-01 13:39:01 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-11-01 13:39:01 +0000
commit4392506d596406634878cce900a6c2626d637ddc (patch)
treef6a5b74a1f54059a7d8da4a3b20ac3e4b3165014 /apps/playback.c
parent33b24a1de0da7d292f9a5d32e15215d251b9c4af (diff)
iRiver: Fixed another mutex issue that caused problems with seeking.
Don't crossfade if audio is paused when selecting a new track. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7711 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 37443df64f..caaee8c5f5 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -576,7 +576,7 @@ static bool rebuffer_and_seek(int newpos)
ci.curpos = newpos;
cur_ti->available = 0;
lseek(current_fd, newpos, SEEK_SET);
-
+
mutex_unlock(&mutex_bufferfill);
while (cur_ti->available == 0 && cur_ti->filerem > 0) {
@@ -584,7 +584,7 @@ static bool rebuffer_and_seek(int newpos)
if (ci.stop_codec || ci.reload_codec)
return false;
}
-
+
return true;
}
@@ -1365,7 +1365,9 @@ void audio_check_buffer(void)
|| ci.reload_codec) && !filling)
return ;
+ mutex_lock(&mutex_bufferfill);
initialize_buffer_fill();
+ mutex_unlock(&mutex_bufferfill);
/* Limit buffering size at first run. */
if (conf_bufferlimit && fill_bytesleft > conf_bufferlimit
@@ -1673,6 +1675,12 @@ void audio_thread(void)
break ;
}
+ /* Do not start crossfading if audio is paused. */
+ if (paused) {
+ audio_stop_playback();
+ paused = false;
+ }
+
logf("starting...");
playing = true;
ci.stop_codec = true;
@@ -1964,8 +1972,6 @@ void audio_play(int offset)
{
logf("audio_play");
last_index = -1;
- paused = false;
- pcm_play_pause(true);
queue_post(&audio_queue, AUDIO_PLAY, (void *)offset);
}