forked from len0rd/rockbox
ppmviewer/rockpaint: do not steal the audiobuffer (and stop playback) if the plugin buffer is large enough
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26750 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c75b713bef
commit
6c522624b3
2 changed files with 19 additions and 7 deletions
|
@ -294,11 +294,17 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
if(!parameter) return PLUGIN_ERROR;
|
||||
|
||||
size_t buffer_size;
|
||||
char *audiobuf = rb->plugin_get_audio_buffer(&buffer_size);
|
||||
char *audiobuf = rb->plugin_get_buffer(&buffer_size);
|
||||
if (buffer_size < PPM_MAXSIZE + LCD_WIDTH * LCD_HEIGHT + 1)
|
||||
{
|
||||
rb->splash(HZ, "Not enough memory");
|
||||
return PLUGIN_ERROR;
|
||||
/* steal from audiobuffer if plugin buffer is too small */
|
||||
audiobuf = rb->plugin_get_audio_buffer(&buffer_size);
|
||||
|
||||
if (buffer_size < PPM_MAXSIZE + LCD_WIDTH * LCD_HEIGHT + 1)
|
||||
{
|
||||
rb->splash(HZ, "Not enough memory");
|
||||
return PLUGIN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
/* align on 16 bits */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue