diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-03-21 15:57:07 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-03-21 15:57:07 +0000 |
commit | 4823b2b1c0b40a3b7068a236bbd8cdabb78f4ff1 (patch) | |
tree | 5a723851b47131c9eb226247d12bc3a53a017211 /apps/buffering.c | |
parent | 82f2bb99ae8440439491af7c20c13bd89d53e713 (diff) | |
download | rockbox-4823b2b1c0b40a3b7068a236bbd8cdabb78f4ff1.tar.gz rockbox-4823b2b1c0b40a3b7068a236bbd8cdabb78f4ff1.zip |
Buffering should truncate if read() returns 0 since it's not a valid return there as there should be data left to read. The loop wouldn't break until there was a message in the queue. I just experienced the case with crosslinked files and read stopped making progress, returning 0 each time it was called.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29626 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/buffering.c')
-rw-r--r-- | apps/buffering.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/buffering.c b/apps/buffering.c index f70400a1ee..578f0f261a 100644 --- a/apps/buffering.c +++ b/apps/buffering.c | |||
@@ -691,7 +691,7 @@ static bool buffer_handle(int handle_id, size_t to_buffer) | |||
691 | /* rc is the actual amount read */ | 691 | /* rc is the actual amount read */ |
692 | int rc = read(h->fd, &buffer[h->widx], copy_n); | 692 | int rc = read(h->fd, &buffer[h->widx], copy_n); |
693 | 693 | ||
694 | if (rc < 0) { | 694 | if (rc <= 0) { |
695 | /* Some kind of filesystem error, maybe recoverable if not codec */ | 695 | /* Some kind of filesystem error, maybe recoverable if not codec */ |
696 | if (h->type == TYPE_CODEC) { | 696 | if (h->type == TYPE_CODEC) { |
697 | logf("Partial codec"); | 697 | logf("Partial codec"); |