Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minor code cleanup.

Replace occurrence of 4 with sizeof(float) where appropriate
  • Loading branch information...
commit ce8844abdc99221d0b12841506958496dfacc77b 1 parent 699918f
@jyavenard jyavenard authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 mythtv/libs/libmyth/audio/audiooutputbase.cpp
View
9 mythtv/libs/libmyth/audio/audiooutputbase.cpp
@@ -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)
@@ -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;
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.