Skip to content

Commit

Permalink
Minor code cleanup.
Browse files Browse the repository at this point in the history
Replace occurrence of 4 with sizeof(float) where appropriate
  • Loading branch information
jyavenard committed Feb 12, 2012
1 parent 699918f commit ce8844a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mythtv/libs/libmyth/audio/audiooutputbase.cpp
Expand Up @@ -742,7 +742,8 @@ void AudioOutputBase::Reconfigure(const AudioSettings &orig_settings)
output_format = output_settings->BestSupportedFormat();
}

bytes_per_frame = processing ? 4 : output_settings->SampleSize(format);
bytes_per_frame = processing ?
sizeof(float) : output_settings->SampleSize(format);
bytes_per_frame *= channels;

if (enc)
Expand Down Expand Up @@ -1213,7 +1214,7 @@ int AudioOutputBase::CopyWithUpmix(char *buffer, int frames, uint &org_waud)

// Upmix to 6ch via FreeSurround
// Calculate frame size of input
off = processing ? 4 : output_settings->SampleSize(format);
off = processing ? sizeof(float) : output_settings->SampleSize(format);
off *= source_channels;

int i = 0;
Expand Down Expand Up @@ -1689,8 +1690,8 @@ int AudioOutputBase::GetAudioData(uchar *buffer, int size, bool full_buffer,
bool fromFloats = processing && !enc && output_format != FORMAT_FLT;

// Scale if necessary
if (fromFloats && obytes != 4)
frag_size *= 4 / obytes;
if (fromFloats && obytes != sizeof(float))
frag_size *= sizeof(float) / obytes;

int off = 0;

Expand Down

0 comments on commit ce8844a

Please sign in to comment.