From dff42011ff41cc1c2e1799e5e4601c45f743fe7e Mon Sep 17 00:00:00 2001 From: SuslikV Date: Mon, 16 Mar 2020 14:49:41 +0200 Subject: [PATCH] Restore default gain when adding audio Incorrect conversion of float to int16_t caused distortion that was mistakenly perceived as clipping. Now because the convertion was fixed, there is no more sense to reduce input gain of the source. --- src/FFmpegReader.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp index 2b03994b..080a652d 100644 --- a/src/FFmpegReader.cpp +++ b/src/FFmpegReader.cpp @@ -1627,9 +1627,8 @@ void FFmpegReader::ProcessAudioPacket(int64_t requested_frame, int64_t target_fr else partial_frame = true; - // Add samples for current channel to the frame. Reduce the volume to 98%, to prevent - // some louder samples from maxing out at 1.0 (not sure why this happens) - f->AddAudio(true, channel_filter, start, iterate_channel_buffer, samples, 0.98f); + // Add samples for current channel to the frame. + f->AddAudio(true, channel_filter, start, iterate_channel_buffer, samples, 1.0f); // Debug output ZmqLogger::Instance()->AppendDebugMethod("FFmpegReader::ProcessAudioPacket (f->AddAudio)", "frame", starting_frame_number, "start", start, "samples", samples, "channel", channel_filter, "partial_frame", partial_frame, "samples_per_frame", samples_per_frame);