Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/mpegts-demuxer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- PTS is now allowed to decrease between packets, allowing support for timestamp rollovers.

## [0.1.0] - 2021-05-13
### Added
Expand Down
4 changes: 2 additions & 2 deletions packages/mpegts-demuxer/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ function decodePes(
const pts = decodeTs(mem, ptr + 3)

if (s.has_dts && pts !== s.dts) { s.frame_ticks = pts - s.dts }
if (pts > s.last_pts || !s.has_pts) { s.last_pts = pts }
s.last_pts = pts

if (s.first_pts === 0
&& s.frame_num === (s.content_type === MEDIA_TYPES.video ? 1 : 0)) {
Expand All @@ -308,7 +308,7 @@ function decodePes(
const dts = decodeTs(mem, ptr + 8)

if (s.has_dts && dts > s.dts) { s.frame_ticks = dts - s.dts }
if (pts > s.last_pts || !s.has_pts) { s.last_pts = pts }
s.last_pts = pts

if (s.first_pts === 0
&& s.frame_num === (s.content_type === MEDIA_TYPES.video ? 1 : 0)) {
Expand Down