summaryrefslogtreecommitdiff
path: root/apps/codecs/Tremor/framing.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/Tremor/framing.c')
-rw-r--r--apps/codecs/Tremor/framing.c69
1 files changed, 0 insertions, 69 deletions
diff --git a/apps/codecs/Tremor/framing.c b/apps/codecs/Tremor/framing.c
index 1cd5c1eb50..4fc4a69d4c 100644
--- a/apps/codecs/Tremor/framing.c
+++ b/apps/codecs/Tremor/framing.c
@@ -469,36 +469,6 @@ ogg_uint32_t ogg_page_pageno(ogg_page *og){
469 return oggbyte_read4(&ob,18); 469 return oggbyte_read4(&ob,18);
470} 470}
471 471
472/* returns the number of packets that are completed on this page (if
473 the leading packet is begun on a previous page, but ends on this
474 page, it's counted */
475
476/* NOTE:
477If a page consists of a packet begun on a previous page, and a new
478packet begun (but not completed) on this page, the return will be:
479 ogg_page_packets(page) ==1,
480 ogg_page_continued(page) !=0
481
482If a page happens to be a single packet that was begun on a
483previous page, and spans to the next page (in the case of a three or
484more page packet), the return will be:
485 ogg_page_packets(page) ==0,
486 ogg_page_continued(page) !=0
487*/
488
489int ogg_page_packets(ogg_page *og){
490 int i;
491 int n;
492 int count=0;
493 oggbyte_buffer ob;
494 oggbyte_init(&ob,og->header);
495
496 n=oggbyte_read1(&ob,26);
497 for(i=0;i<n;i++)
498 if(oggbyte_read1(&ob,27+i)<255)count++;
499 return(count);
500}
501
502/* Static CRC calculation table. See older code in CVS for dead 472/* Static CRC calculation table. See older code in CVS for dead
503 run-time initialization code. */ 473 run-time initialization code. */
504 474
@@ -770,45 +740,6 @@ long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og){
770 return ret; 740 return ret;
771} 741}
772 742
773/* sync the stream and get a page. Keep trying until we find a page.
774 Supress 'sync errors' after reporting the first.
775
776 return values:
777 OGG_HOLE) recapture (hole in data)
778 0) need more data
779 1) page returned
780
781 Returns pointers into buffered data; invalidated by next call to
782 _stream, _clear, _init, or _buffer */
783
784int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og){
785
786 /* all we need to do is verify a page at the head of the stream
787 buffer. If it doesn't verify, we look for the next potential
788 frame */
789
790 while(1){
791 long ret=ogg_sync_pageseek(oy,og);
792 if(ret>0){
793 /* have a page */
794 return 1;
795 }
796 if(ret==0){
797 /* need more data */
798 return 0;
799 }
800
801 /* head did not start a synced page... skipped some bytes */
802 if(!oy->unsynced){
803 oy->unsynced=1;
804 return OGG_HOLE;
805 }
806
807 /* loop. keep looking */
808
809 }
810}
811
812/* clear things to an initial state. Good to call, eg, before seeking */ 743/* clear things to an initial state. Good to call, eg, before seeking */
813int ogg_sync_reset(ogg_sync_state *oy){ 744int ogg_sync_reset(ogg_sync_state *oy){
814 745