diff options
Diffstat (limited to 'recipes/tremor/0007-tremor-more-function-renaming.patch')
-rw-r--r-- | recipes/tremor/0007-tremor-more-function-renaming.patch | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/recipes/tremor/0007-tremor-more-function-renaming.patch b/recipes/tremor/0007-tremor-more-function-renaming.patch index 925c95c7..c52c7ab8 100644 --- a/recipes/tremor/0007-tremor-more-function-renaming.patch +++ b/recipes/tremor/0007-tremor-more-function-renaming.patch @@ -1,7 +1,7 @@ -From 3c409c5ff76b90e0cef72edf4fc36c02f5c79271 Mon Sep 17 00:00:00 2001 -From: Thiago Santos <thiago.sousa.santos@collabora.com> -Date: Mon, 22 Apr 2013 11:16:30 -0300 -Subject: [PATCH 7/8] tremor: more function renaming +From 659b00a71c03efcd12e30f26826f1d362d614dd9 Mon Sep 17 00:00:00 2001 +From: Matthew Waters <matthew@centricular.com> +Date: Tue, 18 Dec 2018 18:05:43 +1100 +Subject: [PATCH] tremor: more function renaming Add ivorbis prefix to some more functions to avoid clashing with libvorbis ones' @@ -10,15 +10,15 @@ As mentioned in the previous commit: This is particularly harmful for iOS applications that link to both libvorbis and tremor as an iOS app puts all symbols together in the same binary. --- - iseeking_example.c | 48 ++++++++--------- - ivorbisfile.h | 58 ++++++++++---------- - ivorbisfile_example.c | 14 ++--- - synthesis.c | 6 +-- - vorbisfile.c | 144 +++++++++++++++++++++++++------------------------- + iseeking_example.c | 48 +++++++------- + ivorbisfile.h | 58 ++++++++--------- + ivorbisfile_example.c | 14 ++-- + synthesis.c | 6 +- + vorbisfile.c | 144 +++++++++++++++++++++--------------------- 5 files changed, 135 insertions(+), 135 deletions(-) diff --git a/iseeking_example.c b/iseeking_example.c -index de534eb..c97d252 100644 +index 2cf2ebd..45b0068 100644 --- a/iseeking_example.c +++ b/iseeking_example.c @@ -39,27 +39,27 @@ void _verify(OggVorbis_File *ov, @@ -107,7 +107,7 @@ index de534eb..c97d252 100644 exit(1); @@ -162,7 +162,7 @@ int main(){ for(i=0;i<1000;i++){ - ogg_int64_t val=(double)rand()*pcmlength/RAND_MAX; + ogg_int64_t val=i==0?0:(double)rand()*pcmlength/RAND_MAX; fprintf(stderr,"\r\t%d [pcm position %ld]... ",i,(long)val); - ret=ov_pcm_seek_page(&ov,val); + ret=ivorbis_ov_pcm_seek_page(&ov,val); @@ -116,7 +116,7 @@ index de534eb..c97d252 100644 exit(1); @@ -181,14 +181,14 @@ int main(){ for(i=0;i<1000;i++){ - ogg_int64_t val=(double)rand()*pcmlength/RAND_MAX; + ogg_int64_t val=i==0?0:(double)rand()*pcmlength/RAND_MAX; fprintf(stderr,"\r\t%d [pcm position %ld]... ",i,(long)val); - ret=ov_pcm_seek(&ov,val); + ret=ivorbis_ov_pcm_seek(&ov,val); @@ -169,10 +169,10 @@ index de534eb..c97d252 100644 } diff --git a/ivorbisfile.h b/ivorbisfile.h -index fda6205..30f30b8 100644 +index f6ecb0e..847ffe8 100644 --- a/ivorbisfile.h +++ b/ivorbisfile.h -@@ -42,7 +42,7 @@ typedef struct { +@@ -43,7 +43,7 @@ typedef struct { int (*seek_func) (void *datasource, ogg_int64_t offset, int whence); int (*close_func) (void *datasource); long (*tell_func) (void *datasource); @@ -181,7 +181,7 @@ index fda6205..30f30b8 100644 #define NOTOPEN 0 #define PARTOPEN 1 -@@ -81,44 +81,44 @@ typedef struct OggVorbis_File { +@@ -82,44 +82,44 @@ typedef struct OggVorbis_File { vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */ vorbis_block vb; /* local working space for packet->PCM decode */ @@ -303,7 +303,7 @@ index 7b0cf10..482e33d 100644 fprintf(stderr,"Done.\n"); return(0); diff --git a/synthesis.c b/synthesis.c -index 1e1d1c7..82148c4 100644 +index ed1be97..37b539e 100644 --- a/synthesis.c +++ b/synthesis.c @@ -24,7 +24,7 @@ @@ -332,19 +332,19 @@ index 1e1d1c7..82148c4 100644 long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op){ diff --git a/vorbisfile.c b/vorbisfile.c -index ac0eb88..5370e7e 100644 +index b842a58..6fa328b 100644 --- a/vorbisfile.c +++ b/vorbisfile.c -@@ -645,7 +645,7 @@ static int _open_seekable2(OggVorbis_File *vf){ - vf->pcmlengths[0]=pcmoffset; +@@ -644,7 +644,7 @@ static int _open_seekable2(OggVorbis_File *vf){ vf->pcmlengths[1]-=pcmoffset; + if(vf->pcmlengths[1]<0)vf->pcmlengths[1]=0; - return(ov_raw_seek(vf,dataoffset)); + return(ivorbis_ov_raw_seek(vf,dataoffset)); } /* clear out the current logical bitstream decoder */ -@@ -866,8 +866,8 @@ static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){ +@@ -865,8 +865,8 @@ static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){ return fseek(f,off,whence); } @@ -355,7 +355,7 @@ index ac0eb88..5370e7e 100644 int offsettest=((f && callbacks.seek_func)?callbacks.seek_func(f,0,SEEK_CUR):-1); ogg_uint32_t *serialno_list=NULL; int serialno_list_size=0; -@@ -904,7 +904,7 @@ static int _ov_open1(void *f,OggVorbis_File *vf,const char *initial, +@@ -903,7 +903,7 @@ static int _ov_open1(void *f,OggVorbis_File *vf,const char *initial, numbers, load subsequent vorbis setup headers */ if((ret=_fetch_headers(vf,vf->vi,vf->vc,&serialno_list,&serialno_list_size,NULL))<0){ vf->datasource=NULL; @@ -364,7 +364,7 @@ index ac0eb88..5370e7e 100644 }else{ /* serial number list for first link needs to be held somewhere for second stage of seekable stream open; this saves having to -@@ -925,14 +925,14 @@ static int _ov_open1(void *f,OggVorbis_File *vf,const char *initial, +@@ -924,14 +924,14 @@ static int _ov_open1(void *f,OggVorbis_File *vf,const char *initial, return(ret); } @@ -381,7 +381,7 @@ index ac0eb88..5370e7e 100644 } return(ret); }else -@@ -943,7 +943,7 @@ static int _ov_open2(OggVorbis_File *vf){ +@@ -942,7 +942,7 @@ static int _ov_open2(OggVorbis_File *vf){ /* clear out the OggVorbis_File struct */ @@ -390,7 +390,7 @@ index ac0eb88..5370e7e 100644 if(vf){ vorbis_block_clear(&vf->vb); vorbis_dsp_clear(&vf->vd); -@@ -981,30 +981,30 @@ int ov_clear(OggVorbis_File *vf){ +@@ -980,30 +980,30 @@ int ov_clear(OggVorbis_File *vf){ 0) OK */ @@ -430,7 +430,7 @@ index ac0eb88..5370e7e 100644 if(ret) fclose(f); return ret; } -@@ -1012,38 +1012,38 @@ int ov_fopen(const char *path,OggVorbis_File *vf){ +@@ -1011,38 +1011,38 @@ int ov_fopen(const char *path,OggVorbis_File *vf){ /* Only partially open the vorbis file; test for Vorbisness, and load the headers for the first chain. Do not seek (although test for @@ -481,7 +481,7 @@ index ac0eb88..5370e7e 100644 return vf->seekable; } -@@ -1056,24 +1056,24 @@ long ov_seekable(OggVorbis_File *vf){ +@@ -1055,24 +1055,24 @@ long ov_seekable(OggVorbis_File *vf){ If you want the actual bitrate field settings, get them from the vorbis_info structs */ @@ -511,7 +511,7 @@ index ac0eb88..5370e7e 100644 }else{ /* return nominal if set */ if(vf->vi[i].bitrate_nominal>0){ -@@ -1096,7 +1096,7 @@ long ov_bitrate(OggVorbis_File *vf,int i){ +@@ -1095,7 +1095,7 @@ long ov_bitrate(OggVorbis_File *vf,int i){ additional data to offer since last call (or at beginning of stream), EINVAL if stream is only partially open */ @@ -520,7 +520,7 @@ index ac0eb88..5370e7e 100644 int link=(vf->seekable?vf->current_link:0); long ret; if(vf->ready_state<OPENED)return(OV_EINVAL); -@@ -1108,9 +1108,9 @@ long ov_bitrate_instant(OggVorbis_File *vf){ +@@ -1107,9 +1107,9 @@ long ov_bitrate_instant(OggVorbis_File *vf){ } /* Guess */ @@ -533,7 +533,7 @@ index ac0eb88..5370e7e 100644 if(i<0){ return(vf->current_serialno); }else{ -@@ -1123,14 +1123,14 @@ long ov_serialnumber(OggVorbis_File *vf,int i){ +@@ -1122,14 +1122,14 @@ long ov_serialnumber(OggVorbis_File *vf,int i){ OV_EINVAL if the stream is not seekable (we can't know the length) or if stream is only partially open */ @@ -550,7 +550,7 @@ index ac0eb88..5370e7e 100644 return(acc); }else{ return(vf->offsets[i+1]-vf->offsets[i]); -@@ -1142,14 +1142,14 @@ ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i){ +@@ -1141,14 +1141,14 @@ ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i){ OV_EINVAL if the stream is not seekable (we can't know the length) or only partially open */ @@ -567,7 +567,7 @@ index ac0eb88..5370e7e 100644 return(acc); }else{ return(vf->pcmlengths[i*2+1]); -@@ -1161,14 +1161,14 @@ ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i){ +@@ -1160,14 +1160,14 @@ ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i){ OV_EINVAL if the stream is not seekable (we can't know the length) or only partially open */ @@ -584,7 +584,7 @@ index ac0eb88..5370e7e 100644 return(acc); }else{ return(((ogg_int64_t)vf->pcmlengths[i*2+1])*1000/vf->vi[i].rate); -@@ -1182,7 +1182,7 @@ ogg_int64_t ov_time_total(OggVorbis_File *vf,int i){ +@@ -1181,7 +1181,7 @@ ogg_int64_t ov_time_total(OggVorbis_File *vf,int i){ returns zero on success, nonzero on failure */ @@ -593,7 +593,7 @@ index ac0eb88..5370e7e 100644 ogg_stream_state work_os; int ret; -@@ -1288,7 +1288,7 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){ +@@ -1287,7 +1287,7 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){ if(!lastblock){ pagepos=_get_next_page(vf,&og,-1); if(pagepos<0){ @@ -602,7 +602,7 @@ index ac0eb88..5370e7e 100644 break; } }else{ -@@ -1387,10 +1387,10 @@ ogg_int64_t rescale64(ogg_int64_t x, ogg_int64_t from, ogg_int64_t to){ +@@ -1386,10 +1386,10 @@ ogg_int64_t rescale64(ogg_int64_t x, ogg_int64_t from, ogg_int64_t to){ Seek to the last [granule marked] page preceding the specified pos location, such that decoding past the returned point will quickly arrive at the requested position. */ @@ -615,16 +615,16 @@ index ac0eb88..5370e7e 100644 if(vf->ready_state<OPENED)return(OV_EINVAL); if(!vf->seekable)return(OV_ENOSEEK); -@@ -1534,7 +1534,7 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){ +@@ -1619,7 +1619,7 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){ if(ogg_page_serialno(&og)==vf->current_serialno && (ogg_page_granulepos(&og)>-1 || !ogg_page_continued(&og))){ - return ov_raw_seek(vf,result); + return ivorbis_ov_raw_seek(vf,result); } - vf->offset=result; } -@@ -1555,7 +1555,7 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){ + } +@@ -1639,7 +1639,7 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){ } /* verify result */ @@ -633,7 +633,7 @@ index ac0eb88..5370e7e 100644 result=OV_EFAULT; goto seek_error; } -@@ -1573,9 +1573,9 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){ +@@ -1657,9 +1657,9 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){ /* seek to a sample offset relative to the decompressed pcm stream returns zero on success, nonzero on failure */ @@ -645,7 +645,7 @@ index ac0eb88..5370e7e 100644 if(ret<0)return(ret); if((ret=_make_decode_ready(vf)))return ret; -@@ -1661,15 +1661,15 @@ int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){ +@@ -1745,15 +1745,15 @@ int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){ if(samples<target) if(_fetch_and_process_packet(vf,NULL,1,1)<=0) @@ -664,7 +664,7 @@ index ac0eb88..5370e7e 100644 int link=-1; ogg_int64_t pcm_total=0; -@@ -1681,7 +1681,7 @@ int ov_time_seek(OggVorbis_File *vf,ogg_int64_t milliseconds){ +@@ -1765,7 +1765,7 @@ int ov_time_seek(OggVorbis_File *vf,ogg_int64_t milliseconds){ /* which bitstream section does this time offset occur in? */ for(link=0;link<vf->links;link++){ @@ -673,7 +673,7 @@ index ac0eb88..5370e7e 100644 if(milliseconds<time_total+addsec)break; time_total+=addsec; pcm_total+=vf->pcmlengths[link*2+1]; -@@ -1692,14 +1692,14 @@ int ov_time_seek(OggVorbis_File *vf,ogg_int64_t milliseconds){ +@@ -1776,14 +1776,14 @@ int ov_time_seek(OggVorbis_File *vf,ogg_int64_t milliseconds){ /* enough information to convert time offset to pcm offset */ { ogg_int64_t target=pcm_total+(milliseconds-time_total)*vf->vi[link].rate/1000; @@ -692,7 +692,7 @@ index ac0eb88..5370e7e 100644 int link=-1; ogg_int64_t pcm_total=0; -@@ -1711,7 +1711,7 @@ int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t milliseconds){ +@@ -1795,7 +1795,7 @@ int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t milliseconds){ /* which bitstream section does this time offset occur in? */ for(link=0;link<vf->links;link++){ @@ -701,7 +701,7 @@ index ac0eb88..5370e7e 100644 if(milliseconds<time_total+addsec)break; time_total+=addsec; pcm_total+=vf->pcmlengths[link*2+1]; -@@ -1722,38 +1722,38 @@ int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t milliseconds){ +@@ -1806,38 +1806,38 @@ int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t milliseconds){ /* enough information to convert time offset to pcm offset */ { ogg_int64_t target=pcm_total+(milliseconds-time_total)*vf->vi[link].rate/1000; @@ -747,7 +747,7 @@ index ac0eb88..5370e7e 100644 if(vf->pcm_offset>=pcm_total)break; } } -@@ -1769,7 +1769,7 @@ ogg_int64_t ov_time_tell(OggVorbis_File *vf){ +@@ -1853,7 +1853,7 @@ ogg_int64_t ov_time_tell(OggVorbis_File *vf){ current bitstream. NULL in the case that the machine is not initialized */ @@ -756,7 +756,7 @@ index ac0eb88..5370e7e 100644 if(vf->seekable){ if(link<0) if(vf->ready_state>=STREAMSET) -@@ -1787,7 +1787,7 @@ vorbis_info *ov_info(OggVorbis_File *vf,int link){ +@@ -1871,7 +1871,7 @@ vorbis_info *ov_info(OggVorbis_File *vf,int link){ } /* grr, strong typing, grr, no templates/inheritence, grr */ @@ -765,7 +765,7 @@ index ac0eb88..5370e7e 100644 if(vf->seekable){ if(link<0) if(vf->ready_state>=STREAMSET) -@@ -1811,7 +1811,7 @@ vorbis_comment *ov_comment(OggVorbis_File *vf,int link){ +@@ -1895,7 +1895,7 @@ vorbis_comment *ov_comment(OggVorbis_File *vf,int link){ nature must surface: Multiple bitstream sections do not necessarily have to have the same number of channels or sampling rate. @@ -774,7 +774,7 @@ index ac0eb88..5370e7e 100644 being decoded along with the PCM data in order that the toplevel application can take action on channel/sample rate changes. This number will be incremented even for streamed (non-seekable) streams -@@ -1831,7 +1831,7 @@ vorbis_comment *ov_comment(OggVorbis_File *vf,int link){ +@@ -1915,7 +1915,7 @@ vorbis_comment *ov_comment(OggVorbis_File *vf,int link){ *section) set to the logical bitstream number */ @@ -783,7 +783,7 @@ index ac0eb88..5370e7e 100644 int i,j; ogg_int32_t **pcm; -@@ -1860,7 +1860,7 @@ long ov_read(OggVorbis_File *vf,char *buffer,int bytes_req,int *bitstream){ +@@ -1944,7 +1944,7 @@ long ov_read(OggVorbis_File *vf,char *buffer,int bytes_req,int *bitstream){ /* yay! proceed to pack data into the byte buffer */ @@ -793,5 +793,5 @@ index ac0eb88..5370e7e 100644 if(samples>(bytes_req/(2*channels))) samples=bytes_req/(2*channels); -- -2.1.4 +2.20.0 |