Changeset 3453:cddb31dd11f9 in roaraudio for libroarpulse


Ignore:
Timestamp:
02/13/10 19:29:03 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

wrote pa_stream_get_time(), wrote dummy pa_stream_get_latency()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarpulse/stream.c

    r3452 r3453  
    613613 * latencies, but may have strange effects if the application is not 
    614614 * able to deal with time going 'backwards'. \since 0.6 */ 
    615 int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec); 
     615int pa_stream_get_time(pa_stream *s, pa_usec_t *r_usec) { 
     616 if ( s == NULL || r_usec == NULL ) 
     617  return -1; 
     618 
     619 *r_usec = s->stream.pos * 1000000 / s->stream.info.rate / s->stream.info.channels; 
     620 
     621 return 0; 
     622} 
    616623 
    617624/** Return the total stream latency. This function is based on 
     
    619626 * result can be negative, i.e. the captured samples are not yet 
    620627 * played. In this case *negative is set to 1. \since 0.6 */ 
    621 int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative); 
     628int pa_stream_get_latency(pa_stream *s, pa_usec_t *r_usec, int *negative) { 
     629 // TODO: Fix this: 
     630 // sinks: lateny of stream, mixer, output... 
     631 // sources: mixer, output, negative 
     632 
     633 if ( r_usec != NULL ) 
     634  *r_usec = 0; 
     635 
     636 if ( negative != NULL ) 
     637  *negative = 0; 
     638 
     639 return 0; 
     640} 
    622641 
    623642/** Return the latest raw timing data structure. The returned pointer 
Note: See TracChangeset for help on using the changeset viewer.