Open spirgiuz opened 1 year ago
@tianyif sorry to bother you, have you had the chance to look at this?
After some debugging I've found that the server adds an additional segment to the start of the playlist when adding the 5th segment. That moves all the existing segments over by 1 and probably explains why the audio discontinuity is about 8 seconds (our target segment size). I'm guessing this is likely not ExoPlayer's problem, because as I recall according to HLS spec, you can only add segments at the end in event playlists.
Media3 Version
ExoPlayer 2.18.6
Devices that reproduce the issue
Xiaomi MiTV running AndroidTV 9 Emulator running any AndroidTV 8 Emulator running Android 11 Sony Bravia VH21 running AndroidTV 10
Devices that do not reproduce the issue
So far all devices tested reproduce the issue.
Reproducible in the demo app?
Yes
Reproduction steps
Expected result
The media plays without any freezes or audio loops.
Actual result
The video freezes, sound loops back to an already played segment. When audio catches up to video, playback normalizes. The logs show a AudioSink$UnexpectedDiscontinuityException:
and some frame drops:
droppedFrames [eventTime=34.04, mediaPos=43.76, window=0, period=0, 167]
On Sony Bravia VH21, after the bug audio/video desync appears.
Playing the same URL after a few minutes, when the event stream is longer than a minute does not reproduce this error anymore.
This issue is not new, it has been present since at least r2.15.1 but probably even earlier.
Media
I will provide URL of a stream that this happens on by email, though it doesn't seem to depend on the stream and happens as long as it's an HLS event stream shorter than a minute.
Bug Report
adb bugreport
to dev.exoplayer@gmail.com after filing this issue.