Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jyavenard committed Dec 3, 2010
1 parent 316f85f commit ee329fe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mythtv/libs/libmyth/audiooutputbase.cpp
Expand Up @@ -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)
{
Expand All @@ -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;
}
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit ee329fe

Please sign in to comment.