package t;

import a0.h;
import a0.k;
import a0.n;
import a0.s;
import android.content.Context;
import android.net.Uri;
import android.util.Log;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.Map;
import t.c;

/* JADX INFO: loaded from: classes.dex */
public class b implements c.InterfaceC0095c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final String f6408a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final Context f6409b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private final Uri f6410c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private Map f6411d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private a f6412e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private s f6413f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private int f6414g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private final String f6415h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private String[] f6416i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private n f6417j;

    class a extends n {

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private RandomAccessFile f6418b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private volatile boolean f6419c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private long f6420d = -1;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        private int f6421e;

        public a(h hVar, int i2) throws FileNotFoundException {
            try {
                this.f6418b = new RandomAccessFile(hVar.f1940a.getPath(), "r");
                this.f6419c = false;
                this.f6421e = i2;
            } catch (FileNotFoundException e2) {
                Log.e(b.this.f6408a, "Invalid uri: " + hVar.f1940a.getPath());
                throw e2;
            }
        }

        @Override // a0.n
        protected void a() {
            try {
                this.f6419c = true;
                this.f6418b.close();
            } catch (IOException e2) {
                Log.e(b.this.f6408a, "File close error. " + e2.toString());
            }
        }

        @Override // a0.n
        protected long c() {
            try {
                return this.f6418b.length();
            } catch (IOException e2) {
                Log.e(b.this.f6408a, "File get size error. " + e2.toString());
                return -1L;
            }
        }

        @Override // a0.n
        protected int e(long j2, byte[] bArr, int i2, int i3) {
            if (this.f6419c) {
                return -1;
            }
            try {
                if (this.f6420d != j2) {
                    this.f6418b.seek(j2);
                }
                int i4 = this.f6418b.read(bArr, i2, i3);
                this.f6420d = j2 + ((long) i4);
                return i4;
            } catch (IOException e2) {
                Log.e(b.this.f6408a, "File read error. " + e2.toString());
                return -1;
            }
        }
    }

    public b(Context context, Uri uri, int i2, String str, Map map) {
        this.f6411d = null;
        this.f6408a = "DefaultRendererBuilder" + str;
        this.f6409b = context;
        this.f6410c = uri;
        this.f6414g = i2;
        this.f6415h = str;
        this.f6411d = map;
    }

    /* JADX WARN: Removed duplicated region for block: B:44:0x0189  */
    /* JADX WARN: Removed duplicated region for block: B:54:0x01e4  */
    @Override // t.c.InterfaceC0095c
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void a(t.c r42) {
        /*
            Method dump skipped, instruction units count: 1048
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: t.b.a(t.c):void");
    }

    @Override // t.c.InterfaceC0095c
    public void b(k.a aVar) {
    }

    @Override // t.c.InterfaceC0095c
    public boolean c() {
        return (this.f6417j != null || "http".equals(this.f6410c.getScheme()) || "https".equals(this.f6410c.getScheme())) ? false : true;
    }

    @Override // t.c.InterfaceC0095c
    public void cancel() {
        a aVar = this.f6412e;
        if (aVar != null) {
            aVar.a();
            this.f6412e = null;
        }
        s sVar = this.f6413f;
        if (sVar != null) {
            sVar.a();
            this.f6413f = null;
        }
    }

    public void e(String... strArr) {
        this.f6416i = strArr;
    }

    public void f(n nVar) {
        this.f6417j = nVar;
    }
}
