Skip to content

[ONEM-41937] Fix sample DTS to prevent deletion of preexisting samples#528

Open
volodymyr-ogorodnik-red wants to merge 1 commit intolgi-wpe-2.38-25Q4from
vogorodnik/ONEM-41937-fix3
Open

[ONEM-41937] Fix sample DTS to prevent deletion of preexisting samples#528
volodymyr-ogorodnik-red wants to merge 1 commit intolgi-wpe-2.38-25Q4from
vogorodnik/ONEM-41937-fix3

Conversation

@volodymyr-ogorodnik-red
Copy link

[EXPERIMENTAL][MSE] Fix sample DTS to prevent deletion of preexisting samples when PTS doesn't conflict

Let's consider a preexisting samples A, B, C, and a new sample N with the following timestamps:

      Decoding time  Presentation time
      -------------  -----------------

Sample A: 827.826164000 827.826164000
Sample B: 827.826164100 827.826164100
Sample C: 827.826164200 827.826164200
Sample N: 827.826125000 827.909542000

These disparities in DTS vs. PTS offsets between samples A and B exist because both samples come from completely different videos (eg: because of ad insertion).

In a timeline:

DTS ···NABC·······
PTS ····ABC···N···

Judging by PTS, the samples A, B, C should remain and theoretically don't need to be erased. However, considering DTS, the samples A, B, C have to be erased, because the sample N would reach the video decoder earlier (by decoding ordering) and change the state of the decoder, making it unsuitable for samples A, B, C.

This commit tries to fix the situation by changing sample N (the new sample) DTS to a value slightly higher than sample C DTS, like this:

       Decoding time  Presentation time
       -------------  -----------------

Sample A: 827.826164000 827.826164000
Sample B: 827.826164100 827.826164100
Sample C: 827.826164200 827.826164200
Sample N: 827.826164201 827.909542000

DTS ····ABCN······
PTS ····ABC···N···

This fix avoids the deletion of samples A, B, C and the potential problems associated with that.

Pull Request Template

File a Bug

All changes should be associated with a bug. The WebKit project is currently using Bugzilla as our bug tracker. Note that multiple changes may be associated with a single bug.

Provided Tooling

The WebKit Project strongly recommends contributors use Tools/Scripts/git-webkit to generate pull requests. See Setup and Contributing Code for how to do this.

Template

If a contributor wishes to file a pull request manually, the template is below. Manually-filed pull requests should contain their commit message as the pull request description, and their commit message should be formatted like the template below.

Additionally, the pull request should be mentioned on Bugzilla, labels applied to the pull request matching the component and version of the Bugzilla associated with the pull request and the pull request assigned to its author.

< bug title >
https://bugs.webkit.org/show_bug.cgi?id=#####

Reviewed by NOBODY (OOPS!).

* path/changed.ext:
(function):
(class.function):

…s when PTS doesn't conflict

 - see original description from WebKit/WebKit#57363 below
 - this also reverts commit 90c814d (disable MP4 edit-lists suppost

[EXPERIMENTAL][MSE] Fix sample DTS to prevent deletion of preexisting samples when PTS doesn't conflict

Let's consider a preexisting samples A, B, C, and a new sample N with the
following timestamps:

          Decoding time  Presentation time
          -------------  -----------------
Sample A: 827.826164000  827.826164000
Sample B: 827.826164100  827.826164100
Sample C: 827.826164200  827.826164200
Sample N: 827.826125000  827.909542000

These disparities in DTS vs. PTS offsets between samples A and B exist
because both samples come from completely different videos (eg: because
of ad insertion).

In a timeline:

DTS ···NABC·······
PTS ····ABC···N···

Judging by PTS, the samples A, B, C should remain and theoretically don't
need to be erased. However, considering DTS, the samples A, B, C have to
be erased, because the sample N would reach the video decoder earlier (by
decoding ordering) and change the state of the decoder, making it
unsuitable for samples A, B, C.

This commit tries to fix the situation by changing sample N (the new
sample) DTS to a value slightly higher than sample C DTS, like this:

           Decoding time  Presentation time
           -------------  -----------------
Sample A:  827.826164000  827.826164000
Sample B:  827.826164100  827.826164100
Sample C:  827.826164200  827.826164200
Sample N: *827.826164201* 827.909542000

DTS ····ABCN······
PTS ····ABC···N···

This fix avoids the deletion of samples A, B, C and the potential
problems associated with that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants