Skip to content

Playback stalls when seeking near the end of a period with a gap #3713

@lkinasiewicz

Description

@lkinasiewicz
Environment
  • Dash.js version: 4.0.0
  • Browser name/version: Chrome 92.0.4515.107
  • OS name/version: MacOS Big Sur
Steps to reproduce
  1. Start playback of a static, multi-period manifest.
  2. Seek near the end of the period that has a gap in the end. E.g. when audio representation ends in 1798.000974 and video representation ends in 1798.055724, seek to 1798.
Observed behavior

Playback stalls, no more data is being buffered. In the logs we can see that the player downloaded the last segment of the representation and does not switch to the next period. It keeps trying to generate a request for the next segment. Looks like the problem is in DashHandler - isMediaFinished keeps returning false in this case.

Maybe instead of this logic:

if (lastSegment.presentationStartTime + lastSegment.duration > bufferingTime) {
return false;
}

it should check if there are more segments in current representation when streaming static manifest? I think it would be more obvious thing to do, but maybe there are some edge cases that I am not aware of?

Console output
[119312][StreamController] Switch to stream 5/1. Seektime is 3996, current playback time is 3996. Seamless period switch is set to true 
[119314][Stream] No text data. 
[119314][Stream] No muxed data. 
[119314][Stream] No image data. 
[119314][SourceBufferSink][video] Updated append window for video. Set start to 3995.897376905 and end to 4026.204209561 
[119314][SourceBufferSink][video] Set MSE timestamp offset to 3995.997376905 
[119315][SourceBufferSink][audio] Updated append window for audio. Set start to 3995.897376905 and end to 4026.204209561 
[119315][SourceBufferSink][audio] Set MSE timestamp offset to 3995.997376905 
[119315][AbrController] Stream ID: 5/1 [video] switch from 0 to 6/6 (buffer: 0) . 
[119316][StreamProcessor][video] Preparing quality switch for type video 
[119316][FragmentModel][video] abort requests 
[119322][ScheduleController][video] Quality has changed, get init request for representationid = 6 
[119323][ScheduleController][audio] Quality has changed, get init request for representationid = 0 
[119406][BufferController][video] Waiting for more buffer before starting playback 
[119407][BufferController][audio] Waiting for more buffer before starting playback 
[119994][PlaybackController] Requesting seek to time: 1798 
[119995][PlaybackController] Seeking to: 1798 
[119995][FragmentModel][video] abort requests 
[119995][StreamProcessor][video] onFragmentLoadingAbandoned request: https://.../mvp/ads/2731706/dash/mpeg4_1080p_high/init.mp4 has been aborted 
[119996][FragmentModel][audio] abort requests 
[119996][StreamProcessor][audio] onFragmentLoadingAbandoned request: https://.../mvp/ads/2731706/dash/mpeg4_audio/init.mp4 has been aborted 
[119996][FragmentModel][video] abort requests 
[119996][FragmentModel][audio] abort requests 
[119996][StreamController] Switch to stream 2/5. Seektime is 1798, current playback time is 1798. Seamless period switch is set to true 
[119998][Stream] No text data. 
[119998][Stream] No muxed data. 
[119998][Stream] No image data. 
[119998][SourceBufferSink][video] Updated append window for video. Set start to 1767.84230842 and end to 1798.065725091 
[119999][SourceBufferSink][video] Set MSE timestamp offset to 1767.94230842 
[119999][SourceBufferSink][audio] Updated append window for audio. Set start to 1767.84230842 and end to 1798.065725091 
[119999][SourceBufferSink][audio] Set MSE timestamp offset to 1767.94230842 
[120001][ScheduleController][video] Quality has changed, get init request for representationid = 5 
[120003][ScheduleController][audio] Quality has changed, get init request for representationid = 1 
[120749][BufferController][video] Append Init fragment video  with representationId: 5  and quality: 6 , data size: 865 
[120750][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/5 and media type video - Url: https://.../mvp/ads/3355016/dash/mpeg4_1080p_high/init.mp4  
[120751][BufferController][video] Waiting for more buffer before starting playback 
[120751][ScheduleController][video] Appended bytes for video and stream id 2/5 
[120752][ScheduleController][video] [video] lastInitializedRepresentationInfo changed to 6 
[120753][ScheduleController][video] Top quality video index has changed from NaN to 6 
[120753][ScheduleController][video] Media segment needed for video and stream id 2/5 
[120753][DashHandler][video] Getting the request for time : 1798 
[120753][DashHandler][video] Index for time 1798 is 5 
[120754][StreamProcessor][video] Next fragment request url for stream id 2/5 and media type video is https://.../mvp/ads/3355016/dash/mpeg4_1080p_high/6.m4s 
[120807][BufferController][audio] Waiting for more buffer before starting playback 
[120811][BufferController][audio] Append Init fragment audio  with representationId: 1  and quality: 0 , data size: 822 
[120811][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/5 and media type audio - Url: https://.../mvp/ads/3355016/dash/mpeg4_audio/init.mp4  
[120811][ScheduleController][audio] Appended bytes for audio and stream id 2/5 
[120812][ScheduleController][audio] [audio] lastInitializedRepresentationInfo changed to 0 
[120813][ScheduleController][audio] Top quality audio index has changed from NaN to 0 
[120813][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[120813][DashHandler][audio] Getting the request for time : 1798 
[120813][DashHandler][audio] Index for time 1798 is 5 
[120813][StreamProcessor][audio] Next fragment request url for stream id 2/5 and media type audio is https://.../mvp/ads/3355016/dash/mpeg4_audio/6.m4s 
[121709][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 2/5 and media type audio - Url: https://.../mvp/ads/3355016/dash/mpeg4_audio/6.m4s  
[121710][BufferController][audio] Buffered range: 1797.958308 - 1798.000974, currentTime =  1798 
[121710][ScheduleController][audio] Appended bytes for audio and stream id 2/5 
[121711][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[121794][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 2/5 and media type video - Url: https://.../mvp/ads/3355016/dash/mpeg4_1080p_high/6.m4s  
[121794][BufferController][video] Buffered range: 1797.972308 - 1798.055724, currentTime =  1798 
[121795][ScheduleController][video] Appended bytes for video and stream id 2/5 
[121796][ScheduleController][video] Media segment needed for video and stream id 2/5 
[121796][StreamProcessor][video] Segment requesting for stream 2/5 has finished 
[121797][Stream] onBufferingCompleted - One streamProcessor has finished but audio one is not buffering completed 
[121797][BufferController][video] checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id 2/5 and type video 
[121856][BufferController][video] Got enough buffer to start 
[122212][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[122713][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[123214][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[123714][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[124215][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[124716][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[125218][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[125719][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[126220][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[126722][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
[127223][ScheduleController][audio] Media segment needed for audio and stream id 2/5 
Expected behavior

After seeking, the player keeps buffering and playing.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions