summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 3d22b90bf5..156723ce51 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1727,7 +1727,7 @@ static bool audio_load_track(size_t offset, bool start_play)
1727 { 1727 {
1728 tracks[track_widx].id3_hid = bufopen(trackname, 0, TYPE_ID3); 1728 tracks[track_widx].id3_hid = bufopen(trackname, 0, TYPE_ID3);
1729 1729
1730 if (tracks[track_widx].id3_hid < 0) 1730 if (tracks[track_widx].id3_hid == ERR_BUFFER_FULL)
1731 { 1731 {
1732 /* Buffer is full. */ 1732 /* Buffer is full. */
1733 get_metadata(&lasttrack_id3, fd, trackname); 1733 get_metadata(&lasttrack_id3, fd, trackname);
@@ -1737,6 +1737,13 @@ static bool audio_load_track(size_t offset, bool start_play)
1737 filling = STATE_FULL; 1737 filling = STATE_FULL;
1738 return false; 1738 return false;
1739 } 1739 }
1740 else if (tracks[track_widx].id3_hid < 0)
1741 {
1742 last_peek_offset--;
1743 close(fd);
1744 logf("Could not add metadata handle");
1745 return false;
1746 }
1740 1747
1741 if (track_widx == track_ridx) 1748 if (track_widx == track_ridx)
1742 { 1749 {
@@ -1809,7 +1816,17 @@ static void audio_finish_load_track(void)
1809 tracks[track_widx].aa_hid = bufopen(aa_path, 0, TYPE_BITMAP); 1816 tracks[track_widx].aa_hid = bufopen(aa_path, 0, TYPE_BITMAP);
1810 1817
1811 if(tracks[track_widx].aa_hid == ERR_BUFFER_FULL) 1818 if(tracks[track_widx].aa_hid == ERR_BUFFER_FULL)
1819 {
1820 filling = STATE_FULL;
1821 logf("buffer is full for now");
1812 return; /* No space for track's album art, not an error */ 1822 return; /* No space for track's album art, not an error */
1823 }
1824 else if (tracks[track_widx].aa_hid < 0)
1825 {
1826 /* another error, do not continue either */
1827 logf("Could not add album art handle");
1828 return;
1829 }
1813 } 1830 }
1814 } 1831 }
1815#endif 1832#endif
@@ -1887,8 +1904,19 @@ static void audio_finish_load_track(void)
1887 1904
1888 tracks[track_widx].audio_hid = bufopen(track_id3->path, file_offset, type); 1905 tracks[track_widx].audio_hid = bufopen(track_id3->path, file_offset, type);
1889 1906
1890 if (tracks[track_widx].audio_hid < 0) 1907 /* No space left, not an error */
1908 if (tracks[track_widx].audio_hid == ERR_BUFFER_FULL)
1909 {
1910 filling = STATE_FULL;
1911 logf("buffer is full for now");
1891 return; 1912 return;
1913 }
1914 else if (tracks[track_widx].audio_hid < 0)
1915 {
1916 /* another error, do not continue either */
1917 logf("Could not add audio data handle");
1918 return;
1919 }
1892 1920
1893 /* All required data is now available for the codec. */ 1921 /* All required data is now available for the codec. */
1894 tracks[track_widx].taginfo_ready = true; 1922 tracks[track_widx].taginfo_ready = true;