/// <summary> /// Reads a video packet, assigning the video header and /// advancing the position to the next packet position. /// </summary> /// <param name="position"> /// A <see cref="long" /> value reference specifying the /// position at which to start reading the packet. This value /// is updated to the position of the next packet. /// </param> void ReadVideoPacket(ref long position) { Seek(position + 4); int length = ReadBlock(2).ToUShort(); long offset = position + 6; while (!video_found && offset < position + length) { if (FindMarker(ref offset) == Marker.VideoSyncPacket) { video_header = new VideoHeader(this, offset + 4); video_found = true; } else { // advance the offset by 6 bytes, so the next iteration of the // loop won't find the same marker and get stuck. 6 bytes because findMarker is a // generic find that could get both PES packets and Stream packets, the smallest // posible pes packet with a size =0 would be 6 bytes. offset += 6; } } position += length; }
/// <summary> /// Reads a video packet, assigning the video header and /// advancing the position to the next packet position. /// </summary> /// <param name="position"> /// A <see cref="long" /> value reference specifying the /// position at which to start reading the packet. This value /// is updated to the position of the next packet. /// </param> void ReadVideoPacket(ref long position) { Seek(position + 4); int length = ReadBlock(2).ToUShort(); long offset = position + 6; while (!video_found && offset < position + length) { if (FindMarker(ref offset) == Marker.VideoSyncPacket) { video_header = new VideoHeader(this, offset + 4); video_found = true; } } position += length; }
/// <summary> /// Reads a video packet, assigning the video header and /// advancing the position to the next packet position. /// </summary> /// <param name="position"> /// A <see cref="long" /> value reference specifying the /// position at which to start reading the packet. This value /// is updated to the position of the next packet. /// </param> void ReadVideoPacket(ref long position) { Seek (position + 4); int length = ReadBlock (2).ToUShort (); long offset = position + 6; while (!video_found && offset < position + length) if (FindMarker (ref offset) == Marker.VideoSyncPacket) { video_header = new VideoHeader (this, offset + 4); video_found = true; } position += length; }
/// <summary> /// Reads a video packet, assigning the video header and /// advancing the position to the next packet position. /// </summary> /// <param name="position"> /// A <see cref="long" /> value reference specifying the /// position at which to start reading the packet. This value /// is updated to the position of the next packet. /// </param> void ReadVideoPacket (ref long position) { Seek (position + 4); int length = ReadBlock (2).ToUShort (); long offset = position + 6; while (!video_found && offset < position + length) if (FindMarker (ref offset) == Marker.VideoSyncPacket) { video_header = new VideoHeader (this, offset + 4); video_found = true; } else { // advance the offset by 6 bytes, so the next iteration of the // loop won't find the same marker and get stuck. 6 bytes because findMarker is a // generic find that could get both PES packets and Stream packets, the smallest // posible pes packet with a size =0 would be 6 bytes. offset += 6; } position += length; }
private void ReadVideoPacket(ref long position) { base.Seek(position + 4L); int num = base.ReadBlock(2).ToUShort(); long num2 = position + 6L; while (!this.video_found && (num2 < (position + num))) { if (this.FindMarker(ref num2) == Marker.VideoSyncPacket) { this.video_header = new VideoHeader(this, num2 + 4L); this.video_found = true; } else { num2 += 6L; } } position += num; }