Skip to content

Commit

Permalink
[Subtitles][WebVTT] Fix reversed pts offset correction
Browse files Browse the repository at this point in the history
  • Loading branch information
CastagnaIT committed Apr 11, 2023
1 parent bcadd75 commit d603ba0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ OverlayMessage COverlayCodecWebVTT::Decode(DemuxPacket* pPacket)

m_webvttHandler.Reset();

m_webvttHandler.SetPeriodStart(pPacket->m_ptsOffsetCorrection);
// WebVTT subtitles has no relation with packet PTS then if
// a period/chapter change happens (e.g. HLS streaming) VP can detect a discontinuity
// and adjust the packet PTS by substracting the pts offset correction value,
// so here we have to adjust WebVTT subtitles PTS by substracting it at same way
m_webvttHandler.SetPeriodStart(pPacket->m_ptsOffsetCorrection * -1);

if (m_isISOFormat)
{
Expand Down

0 comments on commit d603ba0

Please sign in to comment.