diff --git a/app/src/main/java/com/fongmi/android/tv/utils/OkGlideModule.java b/app/src/main/java/com/fongmi/android/tv/utils/OkGlideModule.java index 0742b4a64..5d819c7b4 100644 --- a/app/src/main/java/com/fongmi/android/tv/utils/OkGlideModule.java +++ b/app/src/main/java/com/fongmi/android/tv/utils/OkGlideModule.java @@ -5,7 +5,6 @@ import android.graphics.Bitmap; import android.util.Log; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import com.bumptech.glide.Glide; import com.bumptech.glide.GlideBuilder; @@ -33,11 +32,11 @@ public class OkGlideModule extends AppGlideModule { } @Override - public void registerComponents(@NonNull Context context, @Nullable Glide glide, Registry registry) { + public void registerComponents(@NonNull Context context, @NonNull Glide glide, Registry registry) { + AvifByteBufferBitmapDecoder byteBufferBitmapDecoder = new AvifByteBufferBitmapDecoder(glide.getBitmapPool()); + AvifStreamBitmapDecoder streamBitmapDecoder = new AvifStreamBitmapDecoder(registry.getImageHeaderParsers(), byteBufferBitmapDecoder, glide.getArrayPool()); registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(OkHttp.client())); - AvifByteBufferBitmapDecoder byteBuffer = new AvifByteBufferBitmapDecoder(glide.getBitmapPool()); - AvifStreamBitmapDecoder stream = new AvifStreamBitmapDecoder(registry.getImageHeaderParsers(), byteBuffer, glide.getArrayPool()); - registry.append(ByteBuffer.class, Bitmap.class, byteBuffer); - registry.append(InputStream.class, Bitmap.class, stream); + registry.append(ByteBuffer.class, Bitmap.class, byteBufferBitmapDecoder); + registry.append(InputStream.class, Bitmap.class, streamBitmapDecoder); } } \ No newline at end of file