-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
apply periodStart instead of timestampOffset to text reference times #411
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I think there is still an issue here. Here's how I understand the code: The timestamp offset that is set on the engine is the offset relative to the start of the period. In other words, it is the offset required to calculate the presentation time within the period; the first segment of the period should be 0 in this world. The calls to I think this patch fixes an issue whereby single-period playback won't start until all text fragments have been buffered, but multi-period playback is still broken if there is a text track. Update I looked at this again, and I stand corrected: The issue is that the One solution would be to pass the periodStart all the way through |
The original code looks correct to me. If we are emulating MSE's timestamp offset, we should add the offset to the parsed timestamps. Can you please give us a sample manifest that reproduces your issue? |
Sorry, the PR is misleading, I'm not suggesting we remove the offset, just that the offset be relative to the AST, as opposed to the period start. Here's a sample manifest. I can make playback available if you want to get in touch with me out of band. |
Let me try to be explicit about what I believe that I'm seeing in the text flow. I'm glossing over many parts of the system, but this is how I understand it:
where
So we're subtracting out the PTO twice. I think what we actually want is:
I think the right solution is to pass the I'm happy to move this off to an issue, if you think it is legit. |
Here's why this is difficult to understand. So it's not at all clear to me why this should need to be different for text. In the manifest you attached, your text streams have a Can you send a manifest URL I can use to see this in action? |
I agree that we should be adjusting the timestamps of the media passed to The issue is that we are using the reference start/end time (which are not passed to a normal Sorry this is dragging out. I don't have a great way to make that content to you available publicly, but we might be able to make something work out of band... |
Ah, okay, I see now. It's the buffered ranges that are wrong. |
I'm totally on board with this change now. If you would, please:
You can easily run the tests with ./build/test.py Thanks! |
The reference times are used to calculate the buffer start/end times in text_engine. They already had timestampOffset applied when they were created, we just need to make them period-relative.
I passed Let me know what you think. |
We have repro now and a new test asset to cover this case, but we have another fix in mind. |
Sounds good. Let me know if you need anything else from me. |
This adds a test asset that contains a multi-period asset with subtitles where some of the streams contain presentationTimeOffset, including the text tracks. Related to #411 Change-Id: I0e3da351b05a355b2b79096e66814cbf189133d0
@baconz Please try the latest from master and confirm whether this fixes it for you. |
👍 It works! Thanks, Joey! |
The start/end times are derived from reference times which have
already had the offsets applied. Without this patch, when there
is an offset present we buffer all available text segments at
stream start.