Skip to content

Commit 2fcd241

Browse files
authored
Merge pull request #840 from roderickvd/attenuate-last
Attenuate after normalisation
2 parents ec54ae6 + d8e35bf commit 2fcd241

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

playback/src/player.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,10 +1186,6 @@ impl PlayerInternal {
11861186
Some(mut packet) => {
11871187
if !packet.is_empty() {
11881188
if let AudioPacket::Samples(ref mut data) = packet {
1189-
if let Some(ref editor) = self.audio_filter {
1190-
editor.modify_stream(data)
1191-
}
1192-
11931189
if self.config.normalisation
11941190
&& !(f64::abs(normalisation_factor - 1.0) <= f64::EPSILON
11951191
&& self.config.normalisation_method == NormalisationMethod::Basic)
@@ -1290,18 +1286,13 @@ impl PlayerInternal {
12901286
}
12911287
}
12921288
}
1293-
12941289
*sample *= actual_normalisation_factor;
1295-
1296-
// Extremely sharp attacks, however unlikely, *may* still clip and provide
1297-
// undefined results, so strictly enforce output within [-1.0, 1.0].
1298-
if *sample < -1.0 {
1299-
*sample = -1.0;
1300-
} else if *sample > 1.0 {
1301-
*sample = 1.0;
1302-
}
13031290
}
13041291
}
1292+
1293+
if let Some(ref editor) = self.audio_filter {
1294+
editor.modify_stream(data)
1295+
}
13051296
}
13061297

13071298
if let Err(err) = self.sink.write(&packet, &mut self.converter) {

0 commit comments

Comments
 (0)