/// <summary>
/// Add a frame to the track
/// </summary>
public void AddFrame(UInt32 TrackID, GenericMediaFrame frame)
{
// Ensure correct boxes
if (Tracks == null)
{
Tracks = new traf(TrackID);
AddChild(Tracks);
}
if (TrackID != Tracks.TrackId)
{
throw new Exception("Fragments should only contain a single track");
}
if (Dependencies == null)
{
Dependencies = new sdtp();
AddChild(Dependencies);
}
// Add this frame
Tracks.AddFrame(frame);
Dependencies.AddFrame(frame);
// Add duration
Duration += frame.FrameDuration;
}