Closed defagos closed 6 years ago
Ready for review on the feature/dvr-start-issue
branch.
The problem is now properly understood and fixed.
With a slow connection, stream startup is slow. The player takes time loading the first chunk to be played, but already knows the chunk size because it could retrieve the playlist metadata. If the time to load the first chunk to be played is longer than a chunk, the window will be already offset by a chunk (in this example, 10 seconds):
(CMTimeRange) $20 = {
start = 10000 1000ths of a second {
value = 10000
timescale = 1000
flags = kCMTimeFlags_Valid
epoch = 0
}
duration = 7150000 1000ths of a second {
value = 7150000
timescale = 1000
flags = kCMTimeFlags_Valid
epoch = 0
}
}
Our code was incorrectly fixing the initial desired position to the time range, in this example of a slow startup to 10, making the player start at the beginning of the stream.
Fixing the position is wrong if we want a default start position (kCMTimeZero
) with no initial segment selected. By adding this exception and fixing the position only in other cases, the bug could be fixed.
Reviewed. Tested. Unit tests passed. Nice investigation.
When the network is slow (use e.g. the network link conditioner with the 3G setting), DVR settings very often start at the beginning of the DVR window.
This is a regression introduced with the improved 2.5 position support.
Issue type
Incorrect behavior
Environment information
Reproducibility
Easily reproducible
Steps to reproduce