Fix issue where end of stream wasn't signaled if last pes had length field set#3206
Merged
Conversation
0ba5faf to
ff63427
Compare
24b35da to
10515ec
Compare
|
Is there anything else that needs adjusting? If not, I'd like to merge and test it. |
Contributor
|
Okay, thank you. |
79a7cd2 to
be5a260
Compare
…field set In PesReader, endOfInput wasn't set to true if last pes had length field set. Originally, ExoPlayer was always dropping last frame in pes, it was fixed in androidx#419 for pes without length and this fixes it for pes with length set. Thus, the dumps changed because last sample is now correctly parsed by ExoPlayer for both TsExtractor and PsExtractor. Split packetFinished(boolean) into two methods because: - If pes length is unset, we only know packet is finished once next one starts or stream ends, so we know packet end and stream end at the same time. (This is what was handled so far) - If pes length is set, we may know packet end far before stream ends. Waiting for next pes to know whether to set isEndOfInput would introduce latency issues for ID3 or SCTE-35, but when we don't wait we can't deliver end of stream event later. Thus split off a endOfInputReached() method to deliver end of stream event later, and every codec can override the method that best fits without latency issues.
Contributor
Author
|
I'm really grateful for you being so responsive and helpful while working on getting this chain merged, thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In PesReader, endOfInput wasn't set to true if last pes had length field set. Originally, ExoPlayer was always dropping last frame in pes, it was fixed in #419 for pes without length and this fixes it for pes with length set. Thus, the dumps changed because last sample is now correctly parsed by ExoPlayer for both TsExtractor and PsExtractor.
Split packetFinished(boolean) into two methods because:
Thus split off a endOfInputReached() method to deliver end of stream event later, and every codec can override the method that best fits without latency issues.