forked from len0rd/rockbox
Possible crash fixed while crossfade is enabled.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6891 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ff74e7f18b
commit
deeeb33db1
1 changed files with 26 additions and 28 deletions
|
@ -520,17 +520,16 @@ void pcm_flush_buffer(size_t length)
|
||||||
crossfade_pos -= PCMBUF_SIZE;
|
crossfade_pos -= PCMBUF_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length > 0) {
|
while (length > 0) {
|
||||||
memcpy(&audiobuffer[audiobuffer_pos], buf, length);
|
copy_n = MIN(length, PCMBUF_SIZE - (unsigned)audiobuffer_pos);
|
||||||
|
memcpy(&audiobuffer[audiobuffer_pos], buf, copy_n);
|
||||||
audiobuffer_fillpos = length;
|
audiobuffer_fillpos = length;
|
||||||
goto try_flush;
|
buf += copy_n;
|
||||||
}
|
length -= copy_n;
|
||||||
} else {
|
if (length > 0)
|
||||||
/* if (length == 0) {
|
|
||||||
pcm_flush_fillpos();
|
pcm_flush_fillpos();
|
||||||
audiobuffer_pos = 0;
|
}
|
||||||
return ;
|
}
|
||||||
} */
|
|
||||||
|
|
||||||
audiobuffer_fillpos += length;
|
audiobuffer_fillpos += length;
|
||||||
|
|
||||||
|
@ -551,7 +550,6 @@ void pcm_flush_buffer(size_t length)
|
||||||
}
|
}
|
||||||
pcm_flush_fillpos();
|
pcm_flush_fillpos();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool pcm_insert_buffer(char *buf, size_t length)
|
bool pcm_insert_buffer(char *buf, size_t length)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue