cocos2d/external/android-specific/tremolo/Tremolo/framing.c
int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){

  int serialno=ogg_page_serialno(og);
  int version=ogg_page_version(og);

  /* check the serial number */
  if(serialno!=os->serialno){
    //ogg_page_release(og);
    return OGG_ESERIAL;
  }
  if(version>0){
    //ogg_page_release(og);
    return OGG_EVERSION;
  }

  /* add to fifos */
  if(!os->body_tail){
    os->body_tail=og->body;
    os->body_head=ogg_buffer_walk(og->body);
  }else{
    os->body_head=ogg_buffer_cat(os->body_head,og->body);
  }
  if(!os->header_tail){
    os->header_tail=og->header;
    os->header_head=ogg_buffer_walk(og->header);
    os->lacing_fill=-27;
  }else{
    os->header_head=ogg_buffer_cat(os->header_head,og->header);
  }

  memset(og,0,sizeof(*og));
  return OGG_SUCCESS;
}
/* add the incoming page to the stream state; we decompose the page
   into packet segments here as well. */
add the incoming page to the stream state; we decompose the page
into packet segments here as well.
add the incoming page to the stream state ; we decompose the page into packet segments here as well .
int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){
  int serialno=ogg_page_serialno(og);
  int version=ogg_page_version(og);
  if(serialno!=os->serialno){
    return OGG_ESERIAL;
  }
  if(version>0){
    return OGG_EVERSION;
  }
  if(!os->body_tail){
    os->body_tail=og->body;
    os->body_head=ogg_buffer_walk(og->body);
  }else{
    os->body_head=ogg_buffer_cat(os->body_head,og->body);
  }
  if(!os->header_tail){
    os->header_tail=og->header;
    os->header_head=ogg_buffer_walk(og->header);
    os->lacing_fill=-27;
  }else{
    os->header_head=ogg_buffer_cat(os->header_head,og->header);
  }
  memset(og,0,sizeof(*og));
  return OGG_SUCCESS;
}
int ogg_stream_pagein ( ogg_stream_state * os , ogg_page * og ) { int serialno = ogg_page_serialno ( og ) ; int version = ogg_page_version ( og ) ; if ( serialno != os -> serialno ) { return OGG_ESERIAL ; } if ( version > 0 ) { return OGG_EVERSION ; } if ( ! os -> body_tail ) { os -> body_tail = og -> body ; os -> body_head = ogg_buffer_walk ( og -> body ) ; } else { os -> body_head = ogg_buffer_cat ( os -> body_head , og -> body ) ; } if ( ! os -> header_tail ) { os -> header_tail = og -> header ; os -> header_head = ogg_buffer_walk ( og -> header ) ; os -> lacing_fill = -27 ; } else { os -> header_head = ogg_buffer_cat ( os -> header_head , og -> header ) ; } memset ( og , 0 , sizeof ( * og ) ) ; return OGG_SUCCESS ; }
add the incoming page to the stream state; we decompose the page
into packet segments here as well.
add the incoming page to the stream state ; we decompose the page into packet segments here as well .
/* check the serial number */ //ogg_page_release(og); //ogg_page_release(og); /* add to fifos */