summaryrefslogtreecommitdiff
path: root/ui/glide
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2023-07-18 17:01:22 +0200
committerByteHamster <ByteHamster@users.noreply.github.com>2023-07-18 17:57:40 +0200
commit9f8edd0e9d147ec13532143ae3174d3f71e8219a (patch)
tree4e86e482e3c1f5e1856de4611c02154f8c815127 /ui/glide
parent9be6562b4e4bd4a1487a02a92c68db3625e19d99 (diff)
downloadAntennaPod-9f8edd0e9d147ec13532143ae3174d3f71e8219a.zip
Fix MediaMetadataRetriever on API<29
On SDK<29, this class does not have a close method yet, so the app crashes when using try-with-resources.
Diffstat (limited to 'ui/glide')
-rw-r--r--ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/AudioCoverFetcher.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/AudioCoverFetcher.java b/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/AudioCoverFetcher.java
index d8e265ab5..309afa39d 100644
--- a/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/AudioCoverFetcher.java
+++ b/ui/glide/src/main/java/de/danoeh/antennapod/ui/glide/AudioCoverFetcher.java
@@ -2,13 +2,13 @@ package de.danoeh.antennapod.ui.glide;
import android.content.ContentResolver;
import android.content.Context;
-import android.media.MediaMetadataRetriever;
import android.net.Uri;
import androidx.annotation.NonNull;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.data.DataFetcher;
+import de.danoeh.antennapod.model.MediaMetadataRetrieverCompat;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
@@ -25,7 +25,7 @@ class AudioCoverFetcher implements DataFetcher<InputStream> {
@Override
public void loadData(@NonNull Priority priority, @NonNull DataCallback<? super InputStream> callback) {
- try (MediaMetadataRetriever retriever = new MediaMetadataRetriever()) {
+ try (MediaMetadataRetrieverCompat retriever = new MediaMetadataRetrieverCompat()) {
if (path.startsWith(ContentResolver.SCHEME_CONTENT)) {
retriever.setDataSource(context, Uri.parse(path));
} else {