Skip to content

Commit

Permalink
major brand修改为isml
Browse files Browse the repository at this point in the history
  • Loading branch information
nilaoda committed Nov 29, 2022
1 parent 8905b1e commit b3cf21d
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/N_m3u8DL-RE.Parser/Mp4/MSSMoovProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,11 @@ private byte[] GenFtyp()
using var stream = new MemoryStream();
using var writer = new BinaryWriter2(stream);

writer.Write("iso6"); //major brand
writer.Write("isml"); //major brand
writer.WriteUInt(1); //minor version
writer.Write("isom"); //compatible brand
writer.Write("iso5"); //compatible brand
writer.Write("iso6"); //compatible brand
writer.Write("piff"); //compatible brand
writer.Write("msdh"); //compatible brand

return Box("ftyp", stream.ToArray());
Expand Down Expand Up @@ -762,6 +763,22 @@ private byte[] GenPsshBoxForWideVine()
return psshBox;
}

private byte[] GenMoof()
{
using var stream = new MemoryStream();
using var writer = new BinaryWriter2(stream);

//make senc
writer.WriteUInt(1); //sample_count
writer.Write(new byte[8]); //8 bytes IV

var sencBox = FullBox("senc", 1, 0, stream.ToArray());

var moofBox = Box("moof", sencBox); //Movie Extends Box

return moofBox;
}

public byte[] GenHeader(byte[] firstSegment)
{
new MP4Parser()
Expand Down Expand Up @@ -842,9 +859,11 @@ public byte[] GenHeader()

var moovBox = Box("moov", moovPayload); //Movie Box


stream.Write(moovBox);

//var moofBox = GenMoof(); //Movie Extends Box
//stream.Write(moofBox);

return stream.ToArray();
}
}
Expand Down

0 comments on commit b3cf21d

Please sign in to comment.