summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Yves Avenard <jyavenard@mythtv.org>2011-07-22 17:02:56 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2011-07-22 17:03:55 (GMT)
commit4f999494515b97fc41870fbe8dd27690696ffcff (patch)
tree2f55a5675516eb37e1ea9673b4809e33bd590857
parent7d6970310391bd3d7e9f3cf2138c54371dc1eff4 (diff)
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. Backports SHA:a56a759
-rw-r--r--mythtv/libs/libmyth/audiooutputalsa.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/mythtv/libs/libmyth/audiooutputalsa.cpp b/mythtv/libs/libmyth/audiooutputalsa.cpp
index 854293c..371f808 100644
--- a/mythtv/libs/libmyth/audiooutputalsa.cpp
+++ b/mythtv/libs/libmyth/audiooutputalsa.cpp
@@ -725,7 +725,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);