summaryrefslogtreecommitdiff
path: root/apps/codecs/libtremor/framing.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libtremor/framing.c')
-rw-r--r--apps/codecs/libtremor/framing.c10
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
239static int _os_body_expand(ogg_stream_state *os,int needed){ 239int _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
786int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){ 786int 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