From: Chris B. <chr...@mi...> - 2006-04-19 15:30:32
|
Hi There are three bugs in audio_out.c which prevents a framegrab audio port from choosing the output sample rate and causing xine to resample audio. 1) this->resample_sync_factor is uninitialised. It gets set to 0 by calloc, which causes the calculation of output frames to be zero. --- /* calculate number of output frames (after resampling) */ acc_output_frames = (double) buf->num_frames * this->frame_rate_factor * this->resample_sync_factor + this->output_frame_excess; --- It should be initialised to 1.0. 2) this->output.rate should take account of this->force_rate in ao_change_settings. Normally, you wouldn't force the rate to anything and get the unmodified audio stream, but if you wanted xine to resample for you (which is what force_rate is for), this would now work. 3) The xine_audio_frame_t is populated (in xine_get_next_audio_frame) with values for the input audio, when it should use the output audio - if audio has been resampled/downconverted, these values will not be the same. The attached patch fixes these issues, and allows playing back any audio at a constant 48kHz. Chris Brien |