Changeset 5415:b0e383e49274 in roaraudio for roard


Ignore:
Timestamp:
02/20/12 19:31:33 (8 years ago)
Author:
phi
Branch:
default
Message:

Support MUTE flag on output streams as well (Closes: #194) (pr2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/streams.c

    r5381 r5415  
    23072307 int     is_the_same     = 1; 
    23082308 int     is_vol_eq       = 1; 
     2309 int     is_muted; 
    23092310 int     antiecho        = 0; 
    23102311 ssize_t ret; 
     
    23912392  is_the_same = 0; 
    23922393 
    2393  if ( !streams_get_flag(id, ROAR_FLAG_HWMIXER) ) { 
     2394 is_muted = streams_get_flag(id, ROAR_FLAG_MUTE); 
     2395 
     2396 if ( !is_muted && !streams_get_flag(id, ROAR_FLAG_HWMIXER) ) { 
    23942397  is_vol_eq = need_vol_change(g_sa->channels, &(ss->mixer)) ? 0 : 1; 
    23952398 } 
     
    23982401  antiecho = 1; 
    23992402 
    2400  if ( !is_the_same || !is_vol_eq || antiecho ) { 
     2403 if ( !is_the_same || !is_vol_eq || antiecho || is_muted ) { 
    24012404  olen = ROAR_OUTPUT_CALC_OUTBUFSIZE(&(s->info)); // we hope g_output_buffer_len 
    24022405                                                  // is ROAR_OUTPUT_CALC_OUTBUFSIZE(g_sa) here 
     
    24332436  } 
    24342437 
     2438  ip = obuf; 
     2439 } 
     2440 
     2441 if ( is_muted ) { 
     2442  memset(obuf, 0, (g_sa->bits*ROAR_OUTPUT_BUFFER_SAMPLES*g_sa->channels)/8); 
    24352443  ip = obuf; 
    24362444 } 
Note: See TracChangeset for help on using the changeset viewer.