001package net.bramp.ffmpeg.nut;
002
003import java.io.IOException;
004import org.apache.commons.lang3.math.Fraction;
005
006public class Stream {
007  final StreamHeaderPacket header;
008
009  final Fraction timeBase;
010  long last_pts = 0;
011
012  public Stream(MainHeaderPacket header, StreamHeaderPacket streamHeader) throws IOException {
013    this.header = streamHeader;
014    if (streamHeader.timeBaseId >= header.timeBase.length) {
015      throw new IOException(
016          "Invalid timeBaseId " + streamHeader.timeBaseId + " must be < " + header.timeBase.length);
017    }
018    this.timeBase = header.timeBase[streamHeader.timeBaseId];
019  }
020}