Changeset 2993:daefb5b9bc41 in roaraudio


Ignore:
Timestamp:
10/26/09 18:28:50 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added --io-flush

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarphone.c

    r2991 r2993  
    5959 int64_t dtx_threshold; 
    6060 size_t jumbo_mtu; 
     61 int    ioflush_interval; 
    6162 struct { 
    6263  struct { 
     
    104105 printf("  --server   SERVER    - Set server hostname\n" 
    105106        " --jumbo-mtu MTU       - Sets the MTU for Jumbo Packets\n" 
     107        " --io-flush  INTERVAL  - Flushs output every INTERVAL packets\n" 
    106108       ); 
    107109 
     
    317319 void * outbuf, * micbuf; 
    318320 ssize_t outlen, miclen; 
     321 unsigned long int pkg_count = 0; 
    319322 
    320323 ROAR_DBG("run_stream(*): g_conf.samples = %i, info->bits = %i", g_conf.samples, info->bits); 
     
    348351  } 
    349352 
     353  if ( g_conf.ioflush_interval != -1 ) { 
     354   if ( !(pkg_count % g_conf.ioflush_interval) ) 
     355    roar_vio_sync(s1); 
     356  } 
     357 
    350358  if ( g_conf.transcode ) { 
    351359   ROAR_DBG("run_stream(*): outbuf=%p, len=%lu", outbuf, (unsigned long) len); 
     
    369377  if ( roar_vio_write(s0, outbuf, outlen) != outlen ) 
    370378   break; 
     379 
     380  pkg_count++; 
    371381 } 
    372382 
     
    394404 memset(&g_conf, 0, sizeof(g_conf)); 
    395405 
    396  g_conf.antiecho      = AE_ROARD; 
    397  g_conf.dtx_threshold = -1; 
     406 g_conf.antiecho         = AE_ROARD; 
     407 g_conf.dtx_threshold    = -1; 
     408 g_conf.ioflush_interval = -1; 
    398409 
    399410 memset(&g_cons, 0, sizeof(g_cons)); 
     
    412423  } else if ( strcmp(k, "--jumbo-mtu") == 0 ) { 
    413424   g_conf.jumbo_mtu = atoi(argv[++i]); 
     425  } else if ( strcmp(k, "--io-flush") == 0 ) { 
     426   g_conf.ioflush_interval = atoi(argv[++i]); 
    414427  } else if ( strcmp(k, "--rate") == 0 ) { 
    415428   info.rate = atoi(argv[++i]); 
Note: See TracChangeset for help on using the changeset viewer.