summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Yves Avenard <jyavenard@mythtv.org>2010-12-03 02:19:37 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2010-12-03 03:34:43 (GMT)
commitee329febc8c97e784b2457fd6a1d75691304b2e5 (patch)
tree4d49127c74e69e28dd77d71cbd1f462b7cc2cf85
parent316f85f7cee97656b14cdca5ce73393f985a0a92 (diff)
Make sure buffers used for SSE float conversion are 16 bytes aligned at all time. This forces us to work with 16 bytes lcm size
-rw-r--r--mythtv/libs/libmyth/audiooutputbase.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/mythtv/libs/libmyth/audiooutputbase.cpp b/mythtv/libs/libmyth/audiooutputbase.cpp
index 8f2e548..117f8d8 100644
--- a/mythtv/libs/libmyth/audiooutputbase.cpp
+++ b/mythtv/libs/libmyth/audiooutputbase.cpp
@@ -1115,6 +1115,7 @@ bool AudioOutputBase::AddFrames(void *in_buffer, int in_frames,
int frames_remaining = in_frames;
int frames_offset = 0;
int frames_final = 0;
+ int maxframes = (kAudioSRCInputSize / source_bytes_per_frame) & ~0xf;
while(frames_remaining > 0)
{
@@ -1125,9 +1126,9 @@ bool AudioOutputBase::AddFrames(void *in_buffer, int in_frames,
if (processing)
{
- if (frames * source_channels > (int)kAudioSRCInputSize)
+ if (frames > maxframes)
{
- frames = kAudioSRCInputSize / source_channels;
+ frames = maxframes;
len = frames * source_bytes_per_frame;
frames_offset += len;
}
@@ -1236,7 +1237,7 @@ bool AudioOutputBase::AddFrames(void *in_buffer, int in_frames,
int to_get = 0;
// The AC3 encoder can only work on 128kB of data at a time
int maxframes = ((INBUFSIZE / encoder->FrameSize()) *
- encoder->FrameSize() + 15) & ~0xf;
+ encoder->FrameSize()) & ~0xf;
do
{