Changeset 3451:c8b8a7639039 in roaraudio


Ignore:
Timestamp:
02/13/10 19:20:52 (10 years ago)
Author:
phi
Branch:
default
Message:

implemented pa_stream_get_timing_info() and updated pa_stream_update_timing_info()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarpulse/stream.c

    r3450 r3451  
    5656 pa_sample_spec          sspec; 
    5757 pa_io_event           * io_event; 
     58 pa_timing_info          timinginfo; 
    5859 struct roar_buffer    * iobuffer; 
    5960 struct { 
     
    478479 } 
    479480 
     481 // p->timinginfo 
     482 pa_gettimeofday(&(p->timinginfo.timestamp)); // we should interpolate between time before call and after 
     483 
     484 p->timinginfo.synchronized_clocks    = 0; 
     485 p->timinginfo.sink_usec              = 0; 
     486 p->timinginfo.source_usec            = 0; 
     487 p->timinginfo.transport_usec         = 0; 
     488 p->timinginfo.playing                = p->iobuffer != NULL; 
     489 p->timinginfo.write_index_corrupt    = 1; 
     490 p->timinginfo.write_index            = p->stream.pos * pa_frame_size(&(p->sspec)); 
     491 p->timinginfo.read_index_corrupt     = 1; 
     492 p->timinginfo.read_index             = p->stream.pos * pa_frame_size(&(p->sspec)); 
     493#if 0 /* newer versions */ 
     494 p->timinginfo.configured_sink_usec   = p->timinginfo.sink_usec; 
     495 p->timinginfo.configured_source_usec = p->timinginfo.source_usec; 
     496 p->timinginfo.since_underrun         = 0; 
     497#endif 
     498 
    480499 if ( cb != NULL ) { 
    481500  cb(p, suc, userdata); 
     
    610629 * pa_stream_write() call, not just when a timing update has been 
    611630 * recieved. \since 0.8 */ 
    612 const pa_timing_info* pa_stream_get_timing_info(pa_stream *s); 
     631const pa_timing_info* pa_stream_get_timing_info(pa_stream *s) { 
     632 if ( s == NULL ) 
     633  return NULL; 
     634 
     635 return &(s->timinginfo); 
     636} 
    613637 
    614638/** Return a pointer to the stream's sample specification. \since 0.6 */ 
Note: See TracChangeset for help on using the changeset viewer.