diff options
author | Michael Giacomelli <giac2000@hotmail.com> | 2020-12-09 13:17:05 -0500 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-12-25 17:47:19 +0000 |
commit | ca09f91f647f6677fea7804930d7d1b2c876f76e (patch) | |
tree | 03f6b4e5659deb7f52b315478d8106babaf358ab /apps/buffering.h | |
parent | b5e6c30a61047e89f6cb1299a81453a80b79cc37 (diff) | |
download | rockbox-ca09f91f647f6677fea7804930d7d1b2c876f76e.tar.gz rockbox-ca09f91f647f6677fea7804930d7d1b2c876f76e.zip |
Fix deadlocks when trying to buffer large album art.
Internally, buffering tries to load the entire album art file into the
audio buffer, which will fail if the file is larger than the buffer.
Playback.c interprets a file failing to buffer to mean that the buffer
is full, so it waits for more space and tries again. This results in a
deadlock since the file will never fit.
Change bufopen to return a new error condition when an image file will
not fit on the buffer because it is too large: ERR_BITMAP_TOO_LARGE.
Note that we arbitrarily set "too large" to be within 64KB of the
entire buffer size or larger, this could be adjusted if needed.
Change audio_load_albumart to pass through error messages from bufopen.
In playback.c, check to see why audio_load_albumart fails. If it fails
because the file is too large to buffer, simply ignore the file. If it
fails because the file would fit but the buffer is full, try again
later.
Change-Id: I66799ae26f124b495e1522fce7285332f4cf986f
Diffstat (limited to 'apps/buffering.h')
-rwxr-xr-x[-rw-r--r--] | apps/buffering.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/apps/buffering.h b/apps/buffering.h index fcffcf086c..1a75d865ae 100644..100755 --- a/apps/buffering.h +++ b/apps/buffering.h | |||
@@ -47,6 +47,7 @@ enum data_type { | |||
47 | #define ERR_HANDLE_NOT_DONE -5 | 47 | #define ERR_HANDLE_NOT_DONE -5 |
48 | #define ERR_UNSUPPORTED_TYPE -6 | 48 | #define ERR_UNSUPPORTED_TYPE -6 |
49 | #define ERR_WRONG_THREAD -7 | 49 | #define ERR_WRONG_THREAD -7 |
50 | #define ERR_BITMAP_TOO_LARGE -8 | ||
50 | 51 | ||
51 | /* Initialise the buffering subsystem */ | 52 | /* Initialise the buffering subsystem */ |
52 | void buffering_init(void) INIT_ATTR; | 53 | void buffering_init(void) INIT_ATTR; |