Changeset 388:21a4e03ca575 in roaraudio
- Timestamp:
- 08/06/08 14:58:36 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/streams.c
r382 r388 227 227 228 228 // 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); 230 231 231 232 // calc mul and div: … … 315 316 316 317 // calc how much outlen this has... 317 outlen = (len * mul) / div; 318 // outlen = (len * mul) / div; 319 outlen = (len * info->rate)/stream_info->rate; 318 320 319 321 ROAR_DBG("streams_fill_mixbuffer(*): outlen = %i, buf = %p, len = %i", outlen, in, len); … … 361 363 // hey! we have roar_conv() :) 362 364 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 } 369 374 370 375 // 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 } 381 387 } 382 388 } … … 412 418 return 0; 413 419 } 414 415 420 416 421 int streams_get_mixbuffers (void *** bufferlist, struct roar_audio_info * info, unsigned int pos) {
Note: See TracChangeset
for help on using the changeset viewer.