public override void Read(BoxReader reader) { using (new SizeChecker(this, reader)) { base.Read(reader); TrackHeaderBox.Read(reader); while (this.Size > (ulong)(reader.BaseStream.Position - (long)this.Offset)) { long pos = reader.BaseStream.Position; BoxType next = reader.PeekNextBoxType(); if (next == BoxTypes.Edts) { EdtsBox = new EdtsBox(); EdtsBox.movieTimeScale = movieTimeScale; EdtsBox.Read(reader); } else if (next == BoxTypes.TrackReference) { TrackReferenceBox = new TrackReferenceBox(); TrackReferenceBox.Read(reader); } else if (next == BoxTypes.Media) { MediaBox = new MediaBox(this); MediaBox.Read(reader); } else { Box unknown = new Box(BoxTypes.Any); unknown.Read(reader); Debug.WriteLine(string.Format("Unknow box type {0} in Trak box, skipped", next.ToString())); } } } }