Skip to content

Commit

Permalink
Restore default gain when adding audio
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
SuslikV committed Mar 16, 2020
1 parent c28a8bf commit dff4201
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/FFmpegReader.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit dff4201

Please sign in to comment.