Commit bd75425
committed
Fix PTS underflow collapsing base_decode_time to zero
base_pts90k is set from the first published sample. When a subsequent
sample arrives with a lower PTS the offset was silently clamped to 0,
producing tfdt=0 in the moof. Two scenarios trigger this:
- Small underflow (audio pre-roll / jitter): one or two frames at t=0
is harmless; keep the zero-clamp for this case.
- 33-bit PTS rollover (~26.5 h): sample.pts90k wraps from near 2^33
back to zero while base_pts90k remains large, so every subsequent
sample gets tfdt=0 and the decoder timeline collapses permanently.
Fix: if the backward jump exceeds 2^32 ticks (~13 h, impossible as
normal jitter) treat it as a rollover and reset base_pts90k to the new
PTS. Duration tracking recovers naturally on the next frame via the
existing last_pts / 500 ms clamp logic.1 parent e465834 commit bd75425
1 file changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1400 | 1400 | | |
1401 | 1401 | | |
1402 | 1402 | | |
1403 | | - | |
1404 | | - | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
1405 | 1409 | | |
1406 | | - | |
1407 | | - | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
1408 | 1416 | | |
1409 | 1417 | | |
1410 | 1418 | | |
| |||
0 commit comments