diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playback.c | 12 | ||||
-rw-r--r-- | apps/plugin.c | 8 |
2 files changed, 11 insertions, 9 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 | ||
diff --git a/apps/plugin.c b/apps/plugin.c index edf32d227d..46bc0df44d 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "file.h" | 29 | #include "file.h" |
30 | #include "kernel.h" | 30 | #include "kernel.h" |
31 | #include "sprintf.h" | 31 | #include "sprintf.h" |
32 | #include "logf.h" | ||
32 | #include "screens.h" | 33 | #include "screens.h" |
33 | #include "misc.h" | 34 | #include "misc.h" |
34 | #include "mas.h" | 35 | #include "mas.h" |
@@ -374,15 +375,18 @@ int codec_load_file(const char *plugin, void *parameter) | |||
374 | fd = open(plugin, O_RDONLY); | 375 | fd = open(plugin, O_RDONLY); |
375 | if (fd < 0) { | 376 | if (fd < 0) { |
376 | snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", plugin); | 377 | snprintf(msgbuf, sizeof(msgbuf)-1, "Couldn't load codec: %s", plugin); |
378 | logf("Codec load error:%d", fd); | ||
377 | splash(HZ*2, true, msgbuf); | 379 | splash(HZ*2, true, msgbuf); |
378 | return fd; | 380 | return fd; |
379 | } | 381 | } |
380 | 382 | ||
381 | rc = read(fd, &pluginbuf[0], PLUGIN_BUFFER_SIZE); | 383 | rc = read(fd, &pluginbuf[0], PLUGIN_BUFFER_SIZE); |
382 | if (rc <= 0) | 384 | close(fd); |
385 | if (rc <= 0) { | ||
386 | logf("Codec read error"); | ||
383 | return PLUGIN_ERROR; | 387 | return PLUGIN_ERROR; |
388 | } | ||
384 | plugin_size = rc; | 389 | plugin_size = rc; |
385 | close(fd); | ||
386 | 390 | ||
387 | return codec_load_ram(pluginbuf, plugin_size, parameter, NULL, 0); | 391 | return codec_load_ram(pluginbuf, plugin_size, parameter, NULL, 0); |
388 | } | 392 | } |