Skip to content

ExoPlayer cannot correctly handle HLS live stream when #EXT-X-GAP segments are at the beginning of the playlist #3105

@baldanovaldar

Description

@baldanovaldar

Version

Media3 main branch

More version details

No response

Devices that reproduce the issue

Devices:
Honor Pad X8a NDL-W09, Android 14
Redmi Note 7, Android 10

Server:
Mediamtx v1.9.0

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

ExoPlayer fails to correctly play a live LL-HLS stream that contains #EXT-X-GAP segments at the beginning of the playlist.

The HLS stream is generated by MediaMTX and represents archived video served as a live stream.

When the playlist contains multiple #EXT-X-GAP segments followed by valid media segments, playback stops buffering and never resumes even though valid segments are available.

Other players (VLC, browsers) skip GAP segments correctly and continue playback.

According to the HLS specification, clients should skip segments marked with #EXT-X-GAP.

Steps to reproduce:

  1. Start playback of an LL-HLS live stream containing #EXT-X-GAP segments at the beginning of the playlist.
  2. The playlist initially contains GAP segments followed by valid segments.
  3. ExoPlayer starts loading the playlist.
  4. When encountering GAP segments, playback stalls.
  5. Even when valid segments appear later in the playlist, playback does not recover.

Environment
Android version: Android 10, Android 14
Device: / Pixel
Media3 version: 1.9.2
Stream server: MediaMTX
Stream type: LL-HLS (PART segments)

Expected result

ExoPlayer skips GAP segments and continues playback from the next available media segment.

Actual result

Playback stalls after encountering #EXT-X-GAP segments and never resumes.
Player stays in BUFFERING state even though valid segments are present in the playlist.

Media

Attached playlist example, player configuration, logs and medimtx configuration

playlist_example.txt

player_configuration.txt

player_logs.txt

mediamtx-archive.yml

Bug Report

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions