summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Yves Avenard <jyavenard@mythtv.org>2012-02-12 13:04:28 (GMT)
committer Jean-Yves Avenard <jyavenard@mythtv.org>2012-02-12 13:04:28 (GMT)
commitce8844abdc99221d0b12841506958496dfacc77b (patch)
treefbf9759fe41796d846bfc4a74b16d703784b9aca
parent699918fd9b8dfc01cbff987a19c2999d0c430e7a (diff)
Minor code cleanup.
Replace occurrence of 4 with sizeof(float) where appropriate
-rw-r--r--mythtv/libs/libmyth/audio/audiooutputbase.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/mythtv/libs/libmyth/audio/audiooutputbase.cpp b/mythtv/libs/libmyth/audio/audiooutputbase.cpp
index 837d743..03ba1b7 100644
--- a/mythtv/libs/libmyth/audio/audiooutputbase.cpp
+++ b/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;