Changeset 2150:8809a7d0167c in roaraudio


Ignore:
Timestamp:
07/24/09 16:28:26 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support to change software volume on a output stream

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/streams.c

    r2148 r2150  
    11601160 void  * obuf; 
    11611161 int     olen; 
    1162  int     need_to_free = 0; 
    1163  int     is_the_same  = 1; 
     1162 int     need_to_free    = 0; 
     1163 int     is_the_same     = 1; 
     1164 int     is_vol_eq       = 1; 
    11641165 ssize_t ret; 
    11651166 
     
    12081209  is_the_same = 0; 
    12091210 
    1210  if ( !is_the_same ) { 
     1211 if ( !streams_get_flag(id, ROAR_FLAG_HWMIXER) ) { 
     1212  is_vol_eq = need_vol_change(g_sa->channels, &(ss->mixer)) ? 0 : 1; 
     1213 } 
     1214 
     1215 if ( !is_the_same || !is_vol_eq ) { 
    12111216  olen = ROAR_OUTPUT_CALC_OUTBUFSIZE(&(s->info)); // we hope g_output_buffer_len 
    12121217                                                  // is ROAR_OUTPUT_CALC_OUTBUFSIZE(g_sa) here 
     
    12271232 
    12281233 ip = g_output_buffer; 
     1234 
     1235 if ( !is_vol_eq ) { 
     1236  if ( change_vol(obuf, g_sa->bits, ip, ROAR_OUTPUT_BUFFER_SAMPLES*g_sa->channels, g_sa->channels, &(ss->mixer)) == -1 ) { 
     1237   _return(-1); 
     1238  } 
     1239 
     1240  ip = obuf; 
     1241 } 
    12291242 
    12301243 if ( !is_the_same ) { 
Note: See TracChangeset for help on using the changeset viewer.