Skip to content

Avoid destroying PeriodStream if one is re-created for the same period#1232

Merged
peaBerberian merged 1 commit intomasterfrom
fix/do-not-destroy-period-stream
Apr 4, 2023
Merged

Avoid destroying PeriodStream if one is re-created for the same period#1232
peaBerberian merged 1 commit intomasterfrom
fix/do-not-destroy-period-stream

Conversation

@peaBerberian
Copy link
Collaborator

While doing some debugging on multi-Period contents, we saw some situations where at some Period's boundary, no segment would be loaded, since the v3.30.0.

Though we are still in the process of testing it, I relatedly found what seems like an issue where we could be in some kind of (slow) loop creating and destroying PeriodStream, which is the module allowing to load segment corresponding to a particular DASH period (or related in other transports) when we approach from the end of the previous Period.

To try to fix this logic, I added a check to see if the next PeriodStream wanted was linked to the same Period than the next PeriodStream which was already created, in which case we won't be destroying it immediately, just to re-creating it like we did before.

For the source of this behavior, I think that re-checking that the right PeriodStream is created regularly (more specifically: each time the previous chronological PeriodStream signals that is has no segment to load) is not that bad of an idea, as a security, so I did not change it.

@peaBerberian peaBerberian added bug This is an RxPlayer issue (unexpected result when comparing to the API) DASH Relative to the DASH streaming protocol Priority: 0 (Very high) This issue or PR has a very high priority. Efforts should be concentrated on it first. labels Mar 23, 2023
@peaBerberian peaBerberian force-pushed the fix/do-not-destroy-period-stream branch from fe2e73f to d685c5f Compare March 23, 2023 13:26
While doing some debugging on multi-Period contents, we saw some
situations where at some Period's boundary, no segment would be loaded,
since the `v3.30.0`.

Though we are still in the process of testing it, I relatedly found what
seems like an issue where we could be in some kind of (slow) loop creating
and destroying `PeriodStream`, which is the module allowing to load
segment corresponding to a particular DASH period (or related in other
`transport`s) when we approach from the end of the previous Period.

To try to fix this logic, I added a check to see if the next
`PeriodStream` wanted was linked to the same `Period` than the next
`PeriodStream` which was already created, in which case we won't be
destroying it immediately, just to re-creating it like we did before.

For the source of this behavior, I think that re-checking that the right
`PeriodStream` is created regularly (more specifically: each time the previous
chronological `PeriodStream` signals that is has no segment to load) is not
that bad of an idea, as a security, so I did not change it.
@peaBerberian peaBerberian force-pushed the fix/do-not-destroy-period-stream branch from d685c5f to b576e92 Compare March 23, 2023 13:27
@peaBerberian peaBerberian added this to the 3.30.1 milestone Mar 23, 2023
@peaBerberian peaBerberian merged commit 1a8372c into master Apr 4, 2023
@peaBerberian peaBerberian mentioned this pull request Jun 13, 2023
@peaBerberian peaBerberian modified the milestones: 3.30.1, 3.31.0 Jun 13, 2023
@peaBerberian peaBerberian deleted the fix/do-not-destroy-period-stream branch July 6, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This is an RxPlayer issue (unexpected result when comparing to the API) DASH Relative to the DASH streaming protocol Priority: 0 (Very high) This issue or PR has a very high priority. Efforts should be concentrated on it first.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant