Changeset 382:46b315ef4767 in roaraudio


Ignore:
Timestamp:
08/06/08 00:08:59 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

CF Vorbis: fixed a read() on closed() and a close() before read() bug

Location:
roard
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • roard/codecfilter_vorbis.c

    r362 r382  
    1515 self->current_section      = -1; 
    1616 self->last_section         = -1; 
    17  self->opened               = 0; 
     17 self->opened               =  0; 
     18 self->got_it_running       =  0; 
    1819 self->stream               = info; 
    1920// self->outlen               = ROAR_OUTPUT_BUFFER_SAMPLES * s->info.channels * s->info.bits / 8; // optimal size 
     
    3738  return -1; 
    3839 
    39  ov_clear(&(self->vf)); 
     40 if ( self->got_it_running ) 
     41  ov_clear(&(self->vf)); 
    4042 
    4143 free(inst); 
     
    5557  //printf("cf_vorbis_read(*): opening...\n"); 
    5658  if ( ov_open(self->in, &(self->vf), NULL, 0) < 0 ) { 
    57    free((void*)self); 
     59//   free((void*)self); 
    5860   return 0; 
    5961  } 
     
    6365  return -1; 
    6466 } 
     67 
     68 
     69 self->got_it_running = 1; 
    6570 
    6671 while (todo) { 
  • roard/include/codecfilter_vorbis.h

    r362 r382  
    1919 struct roar_stream_server * stream; 
    2020 OggVorbis_File vf; 
     21 int got_it_running; 
    2122}; 
    2223 
  • roard/streams.c

    r381 r382  
    8282 if ( g_streams[id]->codecfilter != -1 ) { 
    8383  codecfilter_close(g_streams[id]->codecfilter_inst, g_streams[id]->codecfilter); 
     84  g_streams[id]->codecfilter_inst = NULL; 
    8485  g_streams[id]->codecfilter = -1; 
    8586 } 
Note: See TracChangeset for help on using the changeset viewer.