public static FragmentRunEntry Parse(ExtendedBinaryReader br) { var entry = new FragmentRunEntry(); entry.FirstFragment= br.ReadUInt32(); entry.FirstFragmentTimestamp = br.ReadUInt64(); entry.FragmentDuration = br.ReadUInt32(); if(entry.FragmentDuration == 0) entry.DiscontinuityIndicator = br.ReadByte(); else entry.DiscontinuityIndicator = null; return entry; }
public override void Parse(ExtendedBinaryReader br) { base.Parse(br); Version = br.ReadByte(); Flags = br.ReadUInt24(); TimeScale = br.ReadUInt32(); QualityEntryCount = br.ReadByte(); QualitySegmentUrlModifiers = Enumerable.Range(0, QualityEntryCount).Select(i => br.ReadNullTerminatedString()).ToArray(); FragmentRunEntryCount = br.ReadUInt32(); FragmentRunEntryTable = new FragmentRunEntry[FragmentRunEntryCount]; for (uint i = 0; i < FragmentRunEntryCount; i++) FragmentRunEntryTable[i] = FragmentRunEntry.Parse(br); }