Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SubtitleSampleReader] Restored old pts workaound #1522

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

CastagnaIT
Copy link
Collaborator

@CastagnaIT CastagnaIT commented Apr 7, 2024

Description

This problem has been hidden since early ISA versions,
but it was highlighted when i reworked Dash parser and introduced also EXT-X-PROGRAM-DATE-TIME on HLS
the main problem is on DTSorPTS() comparison

{
if (!res || streamReader->DTSorPTS() < res->GetReader()->DTSorPTS())
{

we are comparing audio/video/subtitles,
for audio/video the pts/dts come from demuxer, but subtitles use pts from manifest or from subtitle data "cue" timing
these values not always are comparable with audio/video, because pts/dts that come from demuxer packet data
can be different and makes this package selection totally ineffective

other details on comments:
#1507 (comment)
#1507 (comment)

this PR for now i restore the old behaviour by removing the period start pts from segment pts
this will result that the subtitle "packet" pts will have most of time always a lower pts compared to audio/video
and then will be processed immediately without any control

an appropriate solution will be needed in future
since i think that weird thing can happens anyway
for example with all uses of lastPts variable:

m_lastPts = sr->PTS();

that need to be at same time re-checked

Motivation and context

"fix" #1419 (comment)
"fix" #1507 (comment)

How has this been tested?

D+

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

This problem has been hidden since early ISA versions, now it is explicit for a future appropriate fix
@CastagnaIT CastagnaIT added Type: Fix non-breaking change which fixes an issue v21 Omega labels Apr 7, 2024
@CastagnaIT CastagnaIT requested a review from glennguy April 7, 2024 08:54
@MauriceW67
Copy link

Downloaded the version with the fix from here:

https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Finputstream.adaptive/detail/PR-1522/1/artifacts

Can confirm Disney+ is showing subtitles again with this version. Thanks @CastagnaIT 👍

Copy link
Contributor

@glennguy glennguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are fine. We have to think carefully regarding how to solve the problem outlined in todo comments

@CastagnaIT CastagnaIT merged commit 33d20b2 into xbmc:Omega Apr 9, 2024
10 checks passed
@CastagnaIT CastagnaIT deleted the sub_workaround branch April 9, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Fix non-breaking change which fixes an issue v21 Omega
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants