Skip to content

Should HLS live manifest refreshing consider http request delay? #663

Closed
@baiqindotfubotv

Description

@baiqindotfubotv

I am using exoPlayer to play a live HLS stream. I noticed the exoPlayer doesn't take the network request delay into consideration when scheduling manifest refreshing. Here are some logs I printed in onTimelineUpdate method:

23:34:47.890  E  Manifest refreshed
23:34:52.020  E  Manifest refreshed
23:34:56.212  E  Manifest refreshed
23:35:00.507  E  Manifest refreshed
23:35:04.712  E  Manifest refreshed
23:35:08.881  E  Manifest refreshed
23:35:13.075  E  Manifest refreshed
23:35:17.258  E  Manifest refreshed

As you can see the gap between each refresh is several hundreds of ms greater than segment size (4 seconds). According to the description in 6.3.4 here: https://datatracker.ietf.org/doc/html/draft-pantos-http-live-streaming-16#section-6.3.4:

"When a client loads a Playlist file for the first time or reloads a Playlist file and finds that it has changed since the last time it was loaded, the client MUST wait for at least the target duration before attempting to reload the Playlist file again, measured from the last time the client began loading the Playlist file."

It says the next refresh time should be measured from the last time the client begin loading the Playlist file. However looks like exoPlayer is scheduling next refreshing based on the the timestamp when last loading was finished. I think this is where exoPlayer does the calculation: https://github.com/androidx/media/blob/1.1.1/libraries/exoplayer_hls/src/main/java/androidx/media3/exoplayer/hls/playlist/DefaultHlsPlaylistTracker.java#L764.

When the default playback position is close to the end of live window end, this behavior will cause a lot of bufferings.

So is this expected behavior?

For comparison, DASH manifest refreshing does consider network delay:
https://github.com/androidx/media/blob/1.1.1/libraries/exoplayer_dash/src/main/java/androidx/media3/exoplayer/dash/DashMediaSource.java#L931. And for this reason, when exoPlayer is playing DASH live manifest at a position close to live window end, bufferings seldom happen.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions