Commit f73096eb authored by Jean-Paul Saman's avatar Jean-Paul Saman

alsa output: fix playback of 44100 Hz movies on some audio cards

Some audio cards will fail at configuring the hardware parameters with snd_pcm_hw_params_set_near().
The solution is to use snd_pcm_hw_params_set_buffer_time_min() instead of snd_pcm_hw_params_set_buffer_time_near(),
since the latter restricts buffer time so much that other parameters cannot be adjusted. Hence
the call to snd_pcm_hw_params_set_buffer_time_near() will fail and return an error for movies
with audio rate of 44100 Hz.
parent a410e056
......@@ -497,7 +497,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
/* Set buffer size */
param = AOUT_MAX_ADVANCE_TIME;
val = snd_pcm_hw_params_set_buffer_time_near (pcm, hw, &param, NULL);
val = snd_pcm_hw_params_set_buffer_time_min (pcm, hw, &param, NULL);
if (val)
{
msg_Err (aout, "cannot set buffer duration: %s", snd_strerror (val));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment