Skip to content

Commit ce8844a

Browse files
committed
Minor code cleanup.
Replace occurrence of 4 with sizeof(float) where appropriate
1 parent 699918f commit ce8844a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mythtv/libs/libmyth/audio/audiooutputbase.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,8 @@ void AudioOutputBase::Reconfigure(const AudioSettings &orig_settings)
742742
output_format = output_settings->BestSupportedFormat();
743743
}
744744

745-
bytes_per_frame = processing ? 4 : output_settings->SampleSize(format);
745+
bytes_per_frame = processing ?
746+
sizeof(float) : output_settings->SampleSize(format);
746747
bytes_per_frame *= channels;
747748

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

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

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

16911692
// Scale if necessary
1692-
if (fromFloats && obytes != 4)
1693-
frag_size *= 4 / obytes;
1693+
if (fromFloats && obytes != sizeof(float))
1694+
frag_size *= sizeof(float) / obytes;
16941695

16951696
int off = 0;
16961697

0 commit comments

Comments
 (0)