Changeset 388:21a4e03ca575 in roaraudio


Ignore:
Timestamp:
08/06/08 14:58:36 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added some more debuging lines, use rates not mul and div to calc outlen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/streams.c

    r382 r388  
    227227 
    228228 // calc todo_in 
    229  todo_in = ROAR_OUTPUT_CALC_OUTBUFSIZE(stream_info); 
     229 todo_in = (todo*stream_info->rate)/info->rate; 
     230// todo_in = ROAR_OUTPUT_CALC_OUTBUFSIZE(stream_info); 
    230231 
    231232 // calc mul and div: 
     
    315316 
    316317  // calc how much outlen this has... 
    317   outlen = (len * mul) / div; 
     318//  outlen = (len * mul) / div; 
     319  outlen = (len * info->rate)/stream_info->rate; 
    318320 
    319321  ROAR_DBG("streams_fill_mixbuffer(*): outlen = %i, buf = %p, len = %i", outlen, in, len); 
     
    361363  // hey! we have roar_conv() :) 
    362364 
    363   if ( roar_conv(rest, in, 8*len / stream_info->bits, stream_info, info) == -1 ) 
    364    return -1; 
    365   } 
    366  
    367   if ( change_vol(rest, info->bits, rest, 8*outlen / info->bits, info->channels, &(((struct roar_stream_server*)g_streams[id])->mixer)) == -1 ) 
    368    return -1; 
     365   if ( roar_conv(rest, in, 8*len / stream_info->bits, stream_info, info) == -1 ) { 
     366    ROAR_WARN("streams_fill_mixbuffer(*): can not convert input!"); 
     367    return -1; 
     368   } 
     369 
     370   if ( change_vol(rest, info->bits, rest, 8*outlen / info->bits, info->channels, &(((struct roar_stream_server*)g_streams[id])->mixer)) == -1 ) { 
     371    ROAR_WARN("streams_fill_mixbuffer(*): can not change volume"); 
     372    return -1; 
     373   } 
    369374 
    370375  // we habe outlen bytes more... 
    371   todo    -= outlen; 
    372   rest    += outlen; 
    373   todo_in -= len; 
    374  
    375   roar_buffer_get_len(buf, &len); 
    376   ROAR_DBG("streams_fill_mixbuffer(*): New length of buffer %p is %i", buf, len); 
    377   if ( len == 0 ) { 
    378    roar_buffer_delete(buf, NULL); 
    379   } else { 
    380    stream_unshift_buffer(id, buf); 
     376   todo    -= outlen; 
     377   rest    += outlen; 
     378   todo_in -= len; 
     379 
     380   roar_buffer_get_len(buf, &len); 
     381   ROAR_DBG("streams_fill_mixbuffer(*): New length of buffer %p is %i", buf, len); 
     382   if ( len == 0 ) { 
     383    roar_buffer_delete(buf, NULL); 
     384   } else { 
     385    stream_unshift_buffer(id, buf); 
     386   } 
    381387  } 
    382388 } 
     
    412418 return 0; 
    413419} 
    414  
    415420 
    416421int streams_get_mixbuffers (void *** bufferlist, struct roar_audio_info * info, unsigned int pos) { 
Note: See TracChangeset for help on using the changeset viewer.