summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/playback.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 3d22b90..156723c 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1727,7 +1727,7 @@ static bool audio_load_track(size_t offset, bool start_play)
{
tracks[track_widx].id3_hid = bufopen(trackname, 0, TYPE_ID3);
- if (tracks[track_widx].id3_hid < 0)
+ if (tracks[track_widx].id3_hid == ERR_BUFFER_FULL)
{
/* Buffer is full. */
get_metadata(&lasttrack_id3, fd, trackname);
@@ -1737,6 +1737,13 @@ static bool audio_load_track(size_t offset, bool start_play)
filling = STATE_FULL;
return false;
}
+ else if (tracks[track_widx].id3_hid < 0)
+ {
+ last_peek_offset--;
+ close(fd);
+ logf("Could not add metadata handle");
+ return false;
+ }
if (track_widx == track_ridx)
{
@@ -1809,7 +1816,17 @@ static void audio_finish_load_track(void)
tracks[track_widx].aa_hid = bufopen(aa_path, 0, TYPE_BITMAP);
if(tracks[track_widx].aa_hid == ERR_BUFFER_FULL)
+ {
+ filling = STATE_FULL;
+ logf("buffer is full for now");
return; /* No space for track's album art, not an error */
+ }
+ else if (tracks[track_widx].aa_hid < 0)
+ {
+ /* another error, do not continue either */
+ logf("Could not add album art handle");
+ return;
+ }
}
}
#endif
@@ -1887,8 +1904,19 @@ static void audio_finish_load_track(void)
tracks[track_widx].audio_hid = bufopen(track_id3->path, file_offset, type);
- if (tracks[track_widx].audio_hid < 0)
+ /* No space left, not an error */
+ if (tracks[track_widx].audio_hid == ERR_BUFFER_FULL)
+ {
+ filling = STATE_FULL;
+ logf("buffer is full for now");
return;
+ }
+ else if (tracks[track_widx].audio_hid < 0)
+ {
+ /* another error, do not continue either */
+ logf("Could not add audio data handle");
+ return;
+ }
/* All required data is now available for the codec. */
tracks[track_widx].taginfo_ready = true;