Skip to content

Commit c7e676c

Browse files
authored
mkv: Include channels in codec parameters. (#401)
1 parent 39798f1 commit c7e676c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

symphonia-format-mkv/src/codecs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use symphonia_common::mpeg::video::{
1616
};
1717
use symphonia_common::xiph::audio::flac::{MetadataBlockHeader, MetadataBlockType};
1818
use symphonia_core::audio::sample::SampleFormat;
19+
use symphonia_core::audio::Channels;
1920
use symphonia_core::codecs::audio::well_known::{CODEC_ID_FLAC, CODEC_ID_VORBIS};
2021
use symphonia_core::codecs::audio::AudioCodecParameters;
2122
use symphonia_core::codecs::audio::{well_known::*, AudioCodecId};
@@ -66,6 +67,7 @@ fn make_audio_codec_params(
6667
}
6768

6869
codec_params.with_sample_rate(audio.sampling_frequency.round() as u32);
70+
codec_params.with_channels(Channels::Discrete(audio.channels.get() as u16));
6971

7072
let format = audio.bit_depth.and_then(|bits| match bits.get() {
7173
8 => Some(SampleFormat::S8),

0 commit comments

Comments
 (0)