mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Make bufread and bufgetdata blocking. They now return when enough data is available or when EOF is reached. This improves the API and removes the need for several duplicate waiting loops.
Also fix a few logfqueue messages. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15412 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c70671b652
commit
b838a62adf
4 changed files with 48 additions and 77 deletions
|
@ -227,17 +227,6 @@ static int codec_load_ram(int size, struct codec_api *api)
|
|||
int codec_load_buf(unsigned int hid, int size, struct codec_api *api) {
|
||||
int rc;
|
||||
rc = bufread(hid, size, codecbuf);
|
||||
if (rc < 0) {
|
||||
if (rc == ERR_DATA_NOT_READY) {
|
||||
buf_request_buffer_handle(hid);
|
||||
} else {
|
||||
logf("error loading codec");
|
||||
return CODEC_ERROR;
|
||||
}
|
||||
do {
|
||||
rc = bufread(hid, size, codecbuf);
|
||||
} while (rc == ERR_DATA_NOT_READY);
|
||||
}
|
||||
if (rc < 0) {
|
||||
logf("error loading codec");
|
||||
return CODEC_ERROR;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue