-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postroll didn't end for some HLS stream #6314
Comments
Thanks for reporting. I can reproduce the issue and are currently investigating. Seems to be related to the fact that the ads are not loading and the ad load error is handled in an incorrect way. |
That's actually another bug in our dev branch that needs fixing unrelated to what's reported here. The bug reported in this issue is HLS-specific and happens because we wait for stream information after the postroll which never arrives as the stream already finished loading. |
agreed. postroll works well on the original DASH stream.
|
Thanks for confirming. There is general HLS related bug after playing a postroll ads that we are going to fix. Unfortunately, your stream still won't work after this fix because the last segment doesn't contain video format data. This is quite unusual because HLS clients are usually assuming all tracks to be muxed into all segments to be able to start playback at any point. Is there a way for you to fix that? |
This kind of abnormal HLS stream is converted by a third-party SDK, we haven't found a way to fix it. |
This change was introduced by commits handling how we insert post-rolls into the stream. We now try to load the stream again from behind the post-roll to the end of the stream (that's usually a no-op, because there is nothing between these two points). This allowed us to streamline some of the code around ad insertion and event management and it may prevent unnecessary decoder disabling/enabling. The problem is that HLS without chunkless preparation (or when using media playlists directly as in this case), it needs to load something to setup the stream again. Thinking about it more closely, it should be possible to keep the list of available formats if the source has already been used before. I filed #6336 to track this. |
This situation happens if the first chunk to load is already behind the end of the stream. In this case, the preparation never completes because HlsSampleStreamWrapper gets stuck in a prepared=false and loadingFinished=true state. Gracefully handle this situation by attempting to load the last chunk if still unprepared to ensure that track information is obtained as far as possible. Otherwise, it wouldn't be possible to play anything even when seeking back. Issue:#6314 PiperOrigin-RevId: 264599465
@tonihei thank you for the fix. in https://github.com/google/ExoPlayer/blob/dev-v2/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsSampleStreamWrapper.java#L236, loadingFinished is true, but prepared is false. It works when I removed these lines. if (loadingFinished && !prepared) {
throw new ParserException("Loading finished before preparation is complete.");
} my test code is https://github.com/zzzhc/ExoPlayer, branch: dev-v2-throw-exception-at-end detail logs:
|
Yes, that's expected and due to the missing video data in the last chunk. This should likely be fixed for all practical cases once #6336 is implemented. |
Issue description
We have some HLS streams which are converted from DASH. The last segment of the HLS streams may not contain video frames. ExoPlayer can play well in v2.9.6, but when we upgraded to v2.10.x, the postroll ad won't end, it is always in AD_PROGRESS state.
[REQUIRED] Reproduction steps
demo repo: https://github.com/zzzhc/ExoPlayer, branch: stuck-at-end
the demo is based on imademo, the main changes are using another content_url, ad_tag_url
Link to test content
HLS: https://raw.githubusercontent.com/zzzhc/storage/master/hls/index.m3u8
Ad Tag URL:
https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpostpod&cmsid=496&vid=short_onecue&correlator=
A full bug report captured from the device
will send via email.
Version of ExoPlayer being used
reproduced on v2.10.0, v2.10.1, v2.10.2, v2.10.3, v2.10.4
can't reproduce on v2.9.6
Device(s) and version(s) of Android being used
emulator: android 9.0, 6.0
real devices:
samsung galaxy A tablet (android 7.0.1)
Sony Xperia (android 6.0.1)
Nexus 7 tablet (Android 6.0.1)
Samsung galaxy J8(Android 8.1)
Galaxy note 5 (Android 7)
The text was updated successfully, but these errors were encountered: