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 02:52:51 (GMT)
commit6d782423b5b9f75fb46b4ff0f96f4cf0b84e1e39 (patch)
tree84fec1002a8139d8e5fad8594fc35191daf047cb
parentf067f4361155a8bbe2e2a9da8ab6cf9d0e63ac12 (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/audio/audiooutputbase.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/mythtv/libs/libmyth/audio/audiooutputbase.cpp b/mythtv/libs/libmyth/audio/audiooutputbase.cpp
index 8f2e548..117f8d8 100644
--- a/mythtv/libs/libmyth/audio/audiooutputbase.cpp
+++ b/mythtv/libs/libmyth/audio/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
{