minor fixes with init fragment

This commit is contained in:
Muaz Ahmad 2023-10-25 16:32:12 +05:00
parent 5c323970a3
commit 691d5dd67e
3 changed files with 5 additions and 4 deletions

View file

@ -62,11 +62,12 @@ impl HLSHandler {
let playlist_string = format!("\ let playlist_string = format!("\
#EXTM3U\n\ #EXTM3U\n\
#EXT-X-VERSION:7\n\ #EXT-X-VERSION:7\n\
#EXT-X-TARGETDURATION:{}\n\
#EXT-X-MEDIA-SEQUENCE:{}\n\ #EXT-X-MEDIA-SEQUENCE:{}\n\
#EXT-X-MAP:URI=\"{}init.mp4\"\n\ #EXT-X-MAP:URI=\"{}init.mp4\"\n\
{}\ {}\
#EXT-X-ENDLIST\ #EXT-X-ENDLIST\
", self.curr_media_seq_idx, self.args.segment_prepend.clone(), segment_listing); ", self.args.segment_time, self.curr_media_seq_idx, self.args.segment_prepend.clone(), segment_listing);
let mut f = fs::File::create("stream.m3u8").unwrap(); let mut f = fs::File::create("stream.m3u8").unwrap();
f.write_all(&playlist_string.as_bytes()); f.write_all(&playlist_string.as_bytes());

View file

@ -225,7 +225,7 @@ impl Default for TKHD {
fn default() -> Self { fn default() -> Self {
TKHD { TKHD {
version: 0, version: 0,
flags: 1, flags: 3,
create_time: 0, create_time: 0,
modify_time: 0, modify_time: 0,
track_id: 0, track_id: 0,
@ -435,7 +435,7 @@ impl Default for VMHD {
fn default() -> Self { fn default() -> Self {
VMHD { VMHD {
version: 0, version: 0,
flags: 0, flags: 1,
mode: 0, mode: 0,
opcolor: [0,0,0], opcolor: [0,0,0],
} }

View file

@ -131,7 +131,7 @@ fn get_opus_stsd(sample: Vec<u8>, metadata: &Arc<util::Metadata>) -> mp4::atoms:
dref_idx: 1, dref_idx: 1,
channels: metadata.audio.channels as u16, channels: metadata.audio.channels as u16,
sample_size: 16, sample_size: 16,
sample_rate: metadata.audio.samplerate, sample_rate: metadata.audio.samplerate << 16,
codec_config: mp4::atoms::CodecConfig { atom_name: *b"dOps", data: opus_binding} codec_config: mp4::atoms::CodecConfig { atom_name: *b"dOps", data: opus_binding}
}; };
return mp4::atoms::STSD { return mp4::atoms::STSD {