-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
On 4.3 Gifs do not always play #2541
Comments
I don't seem to be able to reproduce this with Glide's giphy sample. Are you able to with that sample app? Do you have another sample app you might be able to attach the reproduces the issue? |
I had the same problem in my application when bind view holder second time in recyclerView. Call drawable.start() every time can solve this problem temporarily. Had something changed in 4.3 when Glide do clear? |
@michaeimm See my comment above. I don't think anything intentionally changed here. If you can provide some repro steps, or even the code you're using to work around the issue that would help. |
I can confirm I am seeing the same behaviour when upgrading to 2.3.0 |
Thanks @michaeimm I was able to reproduce with the same steps. Introduced by 90b3b9f. The pendingDrawable, if present, is loaded synchronously when the GifDrawable is restarted. The GifDrawable is restarted by ImageViewTarget prior to the GifDrawable being set on the View: glide/library/src/main/java/com/bumptech/glide/request/target/ImageViewTarget.java Lines 113 to 116 in 2371aa6
As a result, getCallback() returns null, which causes the GifDrawable to immediately stop itself here: glide/library/src/main/java/com/bumptech/glide/load/resource/gif/GifDrawable.java Lines 285 to 291 in 2371aa6
Calling
|
After 90b3b9f we have a case where a GifDrawable may load a frame synchronously when it’s started. If the GifDrawable was started before it was attached to a View (and gets a non-null Callback) and the GifDrawable had a frame pending, then the GifDrawable would stop itself in the start() call, causing the drawable not to animate. We can avoid this scenario by changing the order in which we start animated drawables and set them on views so that we only start the drawable after its set on the View. Fixes bumptech#2541
After 90b3b9f we have a case where a GifDrawable may load a frame synchronously when it’s started. If the GifDrawable was started before it was attached to a View (and gets a non-null Callback) and the GifDrawable had a frame pending, then the GifDrawable would stop itself in the start() call, causing the drawable not to animate. We can avoid this scenario by changing the order in which we start animated drawables and set them on views so that we only start the drawable after its set on the View. Fixes bumptech#2541
Device: Nexus 5X. Android 7.1.2
After trying 4.3 I can confirm that Gifs do not always play. Sometimes the same Gif file will not start to play at all, other times will play without problems, and other times will play but at slow motion.
I’ve tried with several different Gif files just to discard if it was a specific file, but the issue happens with any Gif file and not specific to any.
I’ve tried to find a pattern to reproduce the issue, but it happens randomly with any Gif file.
I can confirm that when reverting to 4.2 the issue disappears.
The text was updated successfully, but these errors were encountered: