Skip to content

Commit

Permalink
Under some circumstances, using ALSA due to bad rounding, some audio …
Browse files Browse the repository at this point in the history
…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.

Backports SHA:a56a759
  • Loading branch information
jyavenard committed Jul 22, 2011
1 parent 7d69703 commit 4f99949
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audiooutputalsa.cpp
Expand Up @@ -725,7 +725,7 @@ int AudioOutputALSA::SetParameters(snd_pcm_t *handle, snd_pcm_format_t format,


/* set member variables */ /* set member variables */
soundcard_buffer_size = buffer_size * output_bytes_per_frame; 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 */ /* get the current swparams */
err = snd_pcm_sw_params_current(handle, swparams); err = snd_pcm_sw_params_current(handle, swparams);
Expand Down

0 comments on commit 4f99949

Please sign in to comment.