Changeset 2599:9ec38681332f in roaraudio


Ignore:
Timestamp:
09/11/09 03:09:05 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

support for virtual streams for decoding :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/codecfilter_wave.c

    r2595 r2599  
    6060 int r = -1; 
    6161 char tbuf[44]; 
    62  struct roar_stream * s = ROAR_STREAM(self->stream); 
     62 struct roar_stream * ps = ROAR_STREAM(self->stream); 
     63 struct roar_stream *  s; 
     64 struct roar_audio_info info; 
    6365 uint16_t tmp16; 
    6466 uint32_t tmp32; 
    6567 int codec = -1; 
     68 int vid, fh; 
    6669 
    6770 if ( self->opened ) { 
     
    7376 
    7477  // TODO: write better code here! 
     78 
     79  if ( (fh = streams_get_fh(ps->id)) == -1 ) { 
     80   return -1; 
     81  } 
     82 
     83  if ( (vid = streams_new_virtual(ps->id, &(self->vstream))) == -1 ) { 
     84   return -1; 
     85  } 
     86 
     87  ROAR_DBG("cf_wave_read(*): self->vstream=%p", self->vstream); 
     88 
     89  s = ROAR_STREAM(self->vstream); 
    7590 
    7691  memcpy(&tmp32, tbuf+24, 4); 
     
    104119  } 
    105120 
    106   s->info.codec = codec; 
     121   s->info.codec            = codec; 
     122  self->vstream->codec_orgi = codec; 
     123 
     124  memcpy(&info, &(s->info), sizeof(struct roar_audio_info)); 
     125 
     126  if ( streams_set_fh(vid, fh) == -1 ) { 
     127   return -1; 
     128  } 
     129 
     130/* 
     131  if ( roar_vio_open_pass(&(self->vstream->vio), &(self->stream->vio)) == -1 ) { 
     132   return -1; 
     133  } 
     134*/ 
     135 
     136  memcpy(&(self->vstream->vio), &(self->stream->vio), sizeof(struct roar_vio_calls)); 
     137 
     138  if ( streams_set_fh(ps->id, -1) == -1 ) { 
     139   return -1; 
     140  } 
     141 
     142  memcpy(&(ps->info), &info, sizeof(struct roar_audio_info)); 
    107143 
    108144  self->opened = 1; 
Note: See TracChangeset for help on using the changeset viewer.