diff options
author | Nils Wallménius <nils@rockbox.org> | 2011-10-08 10:09:11 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2011-10-08 10:09:11 +0000 |
commit | e1ea13ee75d545a4a945f5e24b652d8741a675cf (patch) | |
tree | cf1b6a24aaa2bb4deb6ee8eb770d954fdadaa3ff /apps/codecs/libtremor/framing.c | |
parent | b779fcc3ed9adbaf0fda5598f3e26a154f1c1410 (diff) | |
download | rockbox-e1ea13ee75d545a4a945f5e24b652d8741a675cf.tar.gz rockbox-e1ea13ee75d545a4a945f5e24b652d8741a675cf.zip |
libtremor: hack to work around huge allocations for the comment packet in files with embedded album art. Should fix playback of such files on targets with large codec buffers.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30728 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libtremor/framing.c')
-rw-r--r-- | apps/codecs/libtremor/framing.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/codecs/libtremor/framing.c b/apps/codecs/libtremor/framing.c index d67708f87a..582084853a 100644 --- a/apps/codecs/libtremor/framing.c +++ b/apps/codecs/libtremor/framing.c | |||
@@ -236,7 +236,7 @@ int ogg_stream_destroy(ogg_stream_state *os){ | |||
236 | /* Helpers for ogg_stream_encode; this keeps the structure and | 236 | /* Helpers for ogg_stream_encode; this keeps the structure and |
237 | what's happening fairly clear */ | 237 | what's happening fairly clear */ |
238 | 238 | ||
239 | static int _os_body_expand(ogg_stream_state *os,int needed){ | 239 | int _os_body_expand(ogg_stream_state *os,int needed){ |
240 | if(os->body_storage<=os->body_fill+needed){ | 240 | if(os->body_storage<=os->body_fill+needed){ |
241 | void *ret; | 241 | void *ret; |
242 | ret=_ogg_realloc(os->body_data,(os->body_storage+needed+1024)* | 242 | ret=_ogg_realloc(os->body_data,(os->body_storage+needed+1024)* |
@@ -783,7 +783,7 @@ int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og){ | |||
783 | /* add the incoming page to the stream state; we decompose the page | 783 | /* add the incoming page to the stream state; we decompose the page |
784 | into packet segments here as well. */ | 784 | into packet segments here as well. */ |
785 | 785 | ||
786 | int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){ | 786 | int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og, bool copy_body){ |
787 | unsigned char *header=og->header; | 787 | unsigned char *header=og->header; |
788 | unsigned char *body=og->body; | 788 | unsigned char *body=og->body; |
789 | long bodysize=og->body_len; | 789 | long bodysize=og->body_len; |
@@ -868,8 +868,10 @@ int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){ | |||
868 | } | 868 | } |
869 | 869 | ||
870 | if(bodysize){ | 870 | if(bodysize){ |
871 | if(_os_body_expand(os,bodysize)) return -1; | 871 | if(copy_body){ |
872 | memcpy(os->body_data+os->body_fill,body,bodysize); | 872 | if(_os_body_expand(os,bodysize)) return -1; |
873 | memcpy(os->body_data+os->body_fill,body,bodysize); | ||
874 | } | ||
873 | os->body_fill+=bodysize; | 875 | os->body_fill+=bodysize; |
874 | } | 876 | } |
875 | 877 | ||