Changeset 3449:ba42ab088e13 in roaraudio for libroarpulse


Ignore:
Timestamp:
02/13/10 18:55:01 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

support pa_stream_drain()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarpulse/stream.c

    r3441 r3449  
    6868  struct _roar_pa_stream_cb underflow; 
    6969  struct _roar_pa_stream_cb latency; 
     70  struct _roar_pa_stream_cb drain; 
    7071 } cb; 
     72 struct { 
     73  pa_operation * drain; 
     74 } op; 
    7175}; 
    7276 
     
    444448 
    445449/** Drain a playback stream. Use this for notification when the buffer is empty */ 
    446 pa_operation* pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *userdata); 
     450pa_operation* pa_stream_drain(pa_stream *s, pa_stream_success_cb_t cb, void *userdata) { 
     451 if ( s == NULL ) 
     452  return NULL; 
     453 
     454 s->cb.drain.cb.scb   = cb; 
     455 s->cb.drain.userdata = userdata; 
     456 
     457 if ( s->op.drain == NULL ) { 
     458  s->op.drain = roar_pa_operation_new(PA_OPERATION_RUNNING); 
     459 } 
     460 
     461 pa_operation_ref(s->op.drain); 
     462 
     463 return s->op.drain; 
     464} 
    447465 
    448466/** Request a timing info structure update for a stream. Use 
Note: See TracChangeset for help on using the changeset viewer.