Skip to content

Commit

Permalink
[WIP] コーデック名をちゃんとする
Browse files Browse the repository at this point in the history
  • Loading branch information
sile committed Dec 6, 2024
1 parent c653ab6 commit d2af2b6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/mp4-media-stream/wasm/src/mp4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,16 @@ impl AudioDecoderConfig {
}

pub fn from_mp4a_box(b: &Mp4aBox) -> Self {
let mut codec = format!(
"mp4a.{:02X}",
b.esds_box.es.dec_config_descr.object_type_indication
);
if b.esds_box.es.dec_config_descr.object_type_indication == 0x40 {
// TODO: profile を見る
codec.push_str(".2");
};
Self {
codec: "mp4a.40.2".to_owned(),
codec,
sample_rate: b.audio.samplerate.integer,
number_of_channels: b.audio.channelcount as u8,
}
Expand Down

0 comments on commit d2af2b6

Please sign in to comment.