Changeset 635:fb9b242e8cc6 in roaraudio


Ignore:
Timestamp:
08/21/08 17:30:15 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added RoarCELT magic

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/codecfilter_celt.c

    r634 r635  
    3232 self->encoder              = NULL; 
    3333 self->decoder              = NULL; 
     34 self->opened               = 0; 
    3435 self->s_buf                = s->info.channels * self->frame_size * 2; 
    3536 self->ibuf                 = malloc(self->s_buf); 
     
    118119 uint16_t fs; 
    119120 char * cbuf; 
     121 char magic[ROAR_CELT_MAGIC_LEN]; 
    120122 
    121123// printf("buf=%p, len=%i\n", buf, len); 
     124 
     125 if ( !self->opened ) { 
     126  errno = ENOSYS; 
     127  if ( stream_vio_s_read(self->stream, magic, ROAR_CELT_MAGIC_LEN) != ROAR_CELT_MAGIC_LEN ) 
     128   return -1; 
     129  if ( memcmp(magic, ROAR_CELT_MAGIC, ROAR_CELT_MAGIC_LEN) != 0 ) 
     130   return -1; 
     131 
     132  errno = 0; 
     133  self->opened = 1; 
     134 } 
    122135 
    123136 if ( self->fi_rest ) { 
  • roard/include/codecfilter_celt.h

    r361 r635  
    2626 int fi_rest; /* how much is in rest? */ 
    2727 int fo_rest; /* how much is in rest? */ 
     28 int opened; 
    2829}; 
    2930 
Note: See TracChangeset for help on using the changeset viewer.