Changeset 5078:2fffe0b6322c in roaraudio


Ignore:
Timestamp:
06/20/11 04:06:09 (10 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added auto mode

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/libroar/vs.h

    r5076 r5078  
    313313typedef enum roar_vs_ctlcmd roar_vs_ctlcmd; 
    314314 
     315#define ROAR_VS_ASYNCLEVEL_NONE   0 
     316#define ROAR_VS_ASYNCLEVEL_ENABLE 1 
     317#define ROAR_VS_ASYNCLEVEL_AUTO   2 
     318 
    315319int     roar_vs_ctl           (roar_vs_t * vss, roar_vs_ctlcmd cmd, void * argp, int * error); 
    316320 
  • libroar/vs.c

    r5077 r5078  
    9393  int qcmd[ASYNC_QLEN]; 
    9494  int qsubcmd[ASYNC_QLEN]; 
     95  int read_latency; 
     96  int last_backend; 
    9597 } async; 
    9698}; 
     
    143145 vss->async.qsubcmd[vss->async.qlen] = subcmd; 
    144146 vss->async.qlen++; 
     147 
     148 vss->async.read_latency = 0; 
    145149 
    146150 return 0; 
     
    270274 vss->latmes.last_pos = -1; 
    271275 
     276 vss->async.last_backend = ROAR_VS_BACKEND_NONE; 
     277 
    272278 return vss; 
    273279} 
     
    811817 } 
    812818 
     819 vss->async.last_backend = backend; 
    813820 
    814821 if ( backend >= 0 ) { 
     
    924931#endif 
    925932 
     933 vss->async.read_latency = 1; 
     934 
    926935 return lag; 
    927936} 
     
    948957  return roar_vs_latency(vss, backend, error); 
    949958 } else if ( wait == ROAR_VS_NOWAIT ) { 
     959  vss->async.read_latency = 1; 
     960 
    950961  if ( vss->latmes.last_pos == -1 ) { 
    951962   _seterr(ROAR_ERROR_NODATA); 
     
    10191030    break; 
    10201031  } 
     1032 
     1033  vss->async.last_backend = backend; 
     1034 
    10211035  if ( backend >= 0 ) 
    10221036   if ( _send_async_req(vss, ROAR_CMD_GET_STREAM_PARA, ROAR_STREAM_PARA_INFO, backend, error) == -1 ) 
     
    15211535   } 
    15221536  } 
     1537 } 
     1538 
     1539 if ( vss->async.level == ROAR_VS_ASYNCLEVEL_AUTO && !vss->async.lock && 
     1540      vss->async.read_latency                     && !vss->async.qlen ) { 
     1541  roar_vs_latency2(vss, vss->async.last_backend < 0 ? ROAR_VS_BACKEND_NONE : vss->async.last_backend, ROAR_VS_ASYNC, NULL); 
    15231542 } 
    15241543 
Note: See TracChangeset for help on using the changeset viewer.