Skip to content

Commit 56dc25d

Browse files
fix: Fix build failure with passthrough-decoder (#1630)
Fix a build failure with passthrough-decoder enabled which resulted from the change in signature of SymphoniaDecoder::new. We need to update the code path where the feature is enabled but the passthrough decoder is disabled via runtime config, to use the new signature.
1 parent cc818da commit 56dc25d

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

playback/src/player.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,22 +1119,20 @@ impl PlayerTrackLoader {
11191119
})
11201120
};
11211121

1122+
let mut hint = Hint::new();
1123+
if let Some(mime_type) = AudioFiles::mime_type(format) {
1124+
hint.mime_type(mime_type);
1125+
}
1126+
11221127
#[cfg(feature = "passthrough-decoder")]
11231128
let decoder_type = if self.config.passthrough {
11241129
PassthroughDecoder::new(audio_file, format).map(|x| Box::new(x) as Decoder)
11251130
} else {
1126-
symphonia_decoder(audio_file, format)
1131+
symphonia_decoder(audio_file, hint)
11271132
};
11281133

11291134
#[cfg(not(feature = "passthrough-decoder"))]
1130-
let decoder_type = {
1131-
let mut hint = Hint::new();
1132-
if let Some(mime_type) = AudioFiles::mime_type(format) {
1133-
hint.mime_type(mime_type);
1134-
}
1135-
1136-
symphonia_decoder(audio_file, hint)
1137-
};
1135+
let decoder_type = { symphonia_decoder(audio_file, hint) };
11381136

11391137
let normalisation_data = normalisation_data.unwrap_or_else(|| {
11401138
warn!("Unable to get normalisation data, continuing with defaults.");

0 commit comments

Comments
 (0)