improve the performance of short seek #2237
Closed
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.
http://programmingmemojohnchang.blogspot.tw/2016/12/improve-performance-of-short-seek-of.html
Please read in detail by the link above which includes the result of experimental comparison.
For streaming, current flow may hit the case where the whole pre-loaded data will be flushed. However, sometimes it is unnecessary to do so. An example is the short seek to the place a little ahead current playback position (ex, current playback time is 15 second & seek to 18 seconds).
Once all pre-loaded data is flushed, ex: for 4K movie, a painful delay will happen.
Also, it hurts for users who do not have unlimited network data plan.
Some MPEG DASH links such as YouTube are made according to the settings of the max interval between key frames is over 5 seconds. Hence the short seek may probably hit the claimed case.
To improve it, we may take the same way applied in GStreamer which filters the decoded-only samples at renderer.
The experimental result shows:
The experiment is based on branch = release-v2.
The only problem is that I DO NOT understand the flow in branch dev-v2 which forces to add RENDERER_TIMESTAMP_OFFSET_US to renderer offset.
Hence we will get a biased value from onProcessedOutputBuffer.
Since I believe we should report the right time instead, I still put the patch here without taking the offset into account in this patch.
Thanks.