-
Notifications
You must be signed in to change notification settings - Fork 405
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
Preload Manager intermittent crash when devices is offline #1568
Comments
Hi @JosephSanjaya, Thanks for your feedback on the preload manager! Please allow me to clarify more details:
Looking forward your reply! |
Hi @tianyif , thanks for fast response Issue Frequency: I have encountered the issue once in shortform demo, but its really rare in the demo. PreloadLooper: In our app, we’re using the same looper for the preload manager as the one injected for the ExoPlayer’s playbackLooper. Looking forward to any further insights you might have! |
Hi @JosephSanjaya, Thanks for the feedback! Could you please also specify what media (DASH, HLS, and etc.) your app is preloading / playing when you saw this issue? |
Hello @tianyif, we are using HLS media and DASH for DRM Short |
Hi @JosephSanjaya, Thanks so much for the precious information! When the device is offline, the
In fact, upon handling message in Thank you again for reporting this issue! |
Hello @tianyif @tianyif Is there any way to avoid this crash? The number of crashes is increasing, leading to user drop-offs. |
Hi @akash1296-dev, I'm working on the fix of this issue and it will be included in the 1.4.1 release. Meanwhile if you hope to avoid the crash I'd suggest you to temporarily rollback your app to the version before adopting 1.4.0, and roll-forward when 1.4.1 is available. |
When there is an exception thrown from the `LoadTask`, the `Loader` will call `Loader.Callback.onLoadError`. Some implementations of `onLoadError` method may call `MediaPeriod.onContinueLoadingRequested`, and in the `PreloadMediaSource`, its `PreloadMediaPeriodCallback` will be triggered and then it can further call `continueLoading` if it finds needed. However the above process is currently done synchronously, which will cause problem. By calling `continueLoading`, the `Loader` is set with a `currentTask`, and when that long sync logic in `Loader.Callback.onLoadError` ends, the `Loader` will immediately retry, and then a non-null `currentTask` will cause the `IllegalStateException`. Issue: #1568 #cherrypick PiperOrigin-RevId: 662550622
I pushed a change for fixing the |
When there is an exception thrown from the `LoadTask`, the `Loader` will call `Loader.Callback.onLoadError`. Some implementations of `onLoadError` method may call `MediaPeriod.onContinueLoadingRequested`, and in the `PreloadMediaSource`, its `PreloadMediaPeriodCallback` will be triggered and then it can further call `continueLoading` if it finds needed. However the above process is currently done synchronously, which will cause problem. By calling `continueLoading`, the `Loader` is set with a `currentTask`, and when that long sync logic in `Loader.Callback.onLoadError` ends, the `Loader` will immediately retry, and then a non-null `currentTask` will cause the `IllegalStateException`. Issue: androidx#1568 #cherrypick PiperOrigin-RevId: 662550622
OKay got it, will check on it Thanks! @tianyif |
When there is an exception thrown from the `LoadTask`, the `Loader` will call `Loader.Callback.onLoadError`. Some implementations of `onLoadError` method may call `MediaPeriod.onContinueLoadingRequested`, and in the `PreloadMediaSource`, its `PreloadMediaPeriodCallback` will be triggered and then it can further call `continueLoading` if it finds needed. However the above process is currently done synchronously, which will cause problem. By calling `continueLoading`, the `Loader` is set with a `currentTask`, and when that long sync logic in `Loader.Callback.onLoadError` ends, the `Loader` will immediately retry, and then a non-null `currentTask` will cause the `IllegalStateException`. Issue: #1568 PiperOrigin-RevId: 662550622 (cherry picked from commit cd532c5)
The fix is with 1.4.1. The theory I initially stated was incorrect, however, the real theory is similar. I happened to reproduce this issue and found out the crash was only encountered when loading the HLS media playlist. In such case, Please note that in such case the returned The code paths in the previous theory will not cause this issue because for the Sorry for being verbose here! Now that the pushed fix should solve the crash, I'm closing this issue, but do let me know if there is anything wrong when trying out 1.4.1. |
Hello @tianyif, we just finished implementing new features using v1.4.1, and its flawless. Thank you really much for your effort |
Version
Media3 1.4.0
More version details
No response
Devices that reproduce the issue
Emulator Android running android 11 - 15
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
Expected result
When device is offline, video should loaded from memory without any crash
Actual result
Playback crash with following stacktraces:
Media
Not applicable
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.The text was updated successfully, but these errors were encountered: