Skip to content

[SubtitleSampleReader] Fix packet pts#1907

Merged
CastagnaIT merged 2 commits intoxbmc:Piersfrom
CastagnaIT:segmented_subs_fix
Sep 17, 2025
Merged

[SubtitleSampleReader] Fix packet pts#1907
CastagnaIT merged 2 commits intoxbmc:Piersfrom
CastagnaIT:segmented_subs_fix

Conversation

@CastagnaIT
Copy link
Copy Markdown
Collaborator

@CastagnaIT CastagnaIT commented Sep 16, 2025

Description

i suspect a regression of PR #1890
that solved the problem of wrong pts comparisons on CSession::GetNextSample
looks like that the use of PTSDiff is not needed anymore since
CSession::GetNextSample now use "manifest based" pts

i hope this dont cause sideeffects on other subs use cases, touch this code cause always headaches due to difficult in testing all cases

Motivation and context

@cscd98 reported privately that D+ has again subtitle problems
NOTE: D+ have use case of segmented webvtt, on multiple periods

i realized that the problem can be reproduced this way:
play video->enable subs from GUI->seek video back of some time->after the seek the subs segments are initially downloaded but not sent to kodi demuxer ofc subs are now broken

How has this been tested?

The only stream i found affected with this similar problem is
HLS "daserste ARD" tv live stream

and to test HLS multiperiods subs, i used my local test stream "Akmai"

D+ confirmed by cscd98

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • I have read the Contributing document
  • My code follows the Code Guidelines of this project
  • My change requires a change to the Wiki documentation
  • I have updated the documentation accordingly

When ReadFull return false can be for multiple reasons,
e.g. if a stream have few subs segments lead to finish in ahead of the
video, so print this error is wrong.
In case of download error will be already printed on log
@CastagnaIT CastagnaIT added Type: Fix non-breaking change which fixes an issue Component: Subtitles v22 Piers labels Sep 16, 2025
@CastagnaIT CastagnaIT merged commit 7e59060 into xbmc:Piers Sep 17, 2025
11 checks passed
@CastagnaIT CastagnaIT deleted the segmented_subs_fix branch September 17, 2025 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Subtitles Type: Fix non-breaking change which fixes an issue v22 Piers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant