summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2005-06-14 14:36:46 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2005-06-14 14:36:46 +0000
commitef72f996814301fc0ed9cc358f620e67a81486f7 (patch)
tree1f866cd2931eb8fff7f0e904934d13f5d49b2a81 /apps/playback.c
parent58c71e0e366c174fd6f71446758fe311e68f4bee (diff)
downloadrockbox-ef72f996814301fc0ed9cc358f620e67a81486f7.tar.gz
rockbox-ef72f996814301fc0ed9cc358f620e67a81486f7.zip
Fixed a dead lock, file handle leak that caused wps to jam and
selected a smaller i2c timeout value. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6707 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/playback.c b/apps/playback.c
index cda67acbe1..7ef4f7b4bc 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -463,8 +463,6 @@ void audio_fill_file_buffer(void)
463 463
464 if (!queue_empty(&audio_queue)) { 464 if (!queue_empty(&audio_queue)) {
465 logf("Filling interrupted"); 465 logf("Filling interrupted");
466 //close(current_fd);
467 //current_fd = -1;
468 return ; 466 return ;
469 } 467 }
470 468
@@ -1002,6 +1000,11 @@ bool audio_load_track(int offset, bool start_play, int peek_offset)
1002 1000
1003 tracks[track_widx].filepos = i; 1001 tracks[track_widx].filepos = i;
1004 1002
1003 if (current_fd >= 0) {
1004 close(current_fd);
1005 current_fd = -1;
1006 }
1007
1005 /* Leave the file handle open for faster buffer refill. */ 1008 /* Leave the file handle open for faster buffer refill. */
1006 if (tracks[track_widx].filerem != 0) { 1009 if (tracks[track_widx].filerem != 0) {
1007 current_fd = fd; 1010 current_fd = fd;
@@ -1010,7 +1013,6 @@ bool audio_load_track(int offset, bool start_play, int peek_offset)
1010 } else { 1013 } else {
1011 logf("Completely buf."); 1014 logf("Completely buf.");
1012 close(fd); 1015 close(fd);
1013 current_fd = -1;
1014 if (++track_widx >= MAX_TRACK) { 1016 if (++track_widx >= MAX_TRACK) {
1015 track_widx = 0; 1017 track_widx = 0;
1016 } 1018 }
@@ -1485,10 +1487,6 @@ void audio_next(void)
1485 ci.stop_codec = true; 1487 ci.stop_codec = true;
1486 playlist_next(1); 1488 playlist_next(1);
1487 queue_post(&audio_queue, AUDIO_PLAY, 0); 1489 queue_post(&audio_queue, AUDIO_PLAY, 0);
1488 } else {
1489#ifndef SIMULATOR
1490 pcm_play_stop();
1491#endif
1492 } 1490 }
1493} 1491}
1494 1492