package com.fyber.inneractive.sdk.util; import android.graphics.Bitmap; import android.media.MediaMetadataRetriever; import com.fyber.inneractive.sdk.player.cache.j; import java.io.File; /* loaded from: classes2.dex */ public final class i implements j.f { public File a; public Bitmap b; public final void a(File file) { long currentTimeMillis = System.currentTimeMillis(); MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever(); try { try { try { mediaMetadataRetriever.setDataSource(file.getPath()); mediaMetadataRetriever.extractMetadata(8192); Bitmap frameAtTime = mediaMetadataRetriever.getFrameAtTime(1L); this.b = frameAtTime; if (frameAtTime != null && frameAtTime.getWidth() > 0 && this.b.getHeight() > 0) { this.a = file; } mediaMetadataRetriever.release(); } catch (Throwable th) { try { mediaMetadataRetriever.release(); } catch (Throwable unused) { } throw th; } } catch (Exception e) { IAlog.a("Failed getting frame from video file%s", t.a(e)); mediaMetadataRetriever.release(); } } catch (Throwable unused2) { } IAlog.e("FirstFrameDownloadMediaProcessor processing finished in %dms", Long.valueOf(System.currentTimeMillis() - currentTimeMillis)); } }