Permalink
Browse files

Under some circumstances, using ALSA due to bad rounding, some audio …

…samples would be lost.

Should the number of frames for period_size returned by ALSA be an odd-number, some samples would be lost.

Fix #9930.
  • Loading branch information...
1 parent 1999d78 commit a56a7594102ee5fe05383d8fb68826efd8a6cf9c @jyavenard jyavenard committed Jul 22, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 mythtv/libs/libmyth/audio/audiooutputalsa.cpp
@@ -728,7 +728,7 @@ int AudioOutputALSA::SetParameters(snd_pcm_t *handle, snd_pcm_format_t format,
/* set member variables */
soundcard_buffer_size = buffer_size * output_bytes_per_frame;
- fragment_size = (period_size * output_bytes_per_frame) >> 1;
+ fragment_size = (period_size >> 1) * output_bytes_per_frame;
/* get the current swparams */
err = snd_pcm_sw_params_current(handle, swparams);

0 comments on commit a56a759

Please sign in to comment.