package defpackage;

import android.content.Context;
import android.media.MediaCodec;
import android.media.MediaCrypto;
import android.media.MediaCryptoException;
import android.media.MediaFormat;
import android.os.Build;
import android.os.Bundle;
import androidx.media3.exoplayer.ExoPlaybackException;
import androidx.media3.exoplayer.mediacodec.MediaCodecDecoderException;
import androidx.media3.exoplayer.mediacodec.MediaCodecRenderer$DecoderInitializationException;
import androidx.media3.exoplayer.mediacodec.MediaCodecUtil$DecoderQueryException;
import j$.util.Objects;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

/* renamed from: ᵻˀ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public abstract class AbstractC5180 extends AbstractC4483 {

    /* renamed from: ᵤʢ, reason: contains not printable characters */
    public static final byte[] f19285 = {0, 0, 1, 103, 66, -64, 11, -38, 37, -112, 0, 0, 1, 104, -50, 15, 19, 32, 0, 0, 1, 101, -120, -124, 13, -50, 113, 24, -96, 0, 47, -65, 28, 49, -61, 39, 93, 120};

    /* renamed from: ʽᵙᵕ, reason: contains not printable characters */
    public boolean f19286;

    /* renamed from: ʽᵢˊ, reason: contains not printable characters */
    public ArrayDeque f19287;

    /* renamed from: ʾˋˊᵽ, reason: contains not printable characters */
    public boolean f19288;

    /* renamed from: ʾᵵᵯ, reason: contains not printable characters */
    public C0397 f19289;

    /* renamed from: ʾᵻᵭٴ, reason: contains not printable characters */
    public MediaCrypto f19290;

    /* renamed from: ʿᵘˆ, reason: contains not printable characters */
    public C0381 f19291;

    /* renamed from: ˀˁᵨ, reason: contains not printable characters */
    public C3446 f19292;

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public final boolean f19293;

    /* renamed from: ˁᵳˉ, reason: contains not printable characters */
    public boolean f19294;

    /* renamed from: ˆʕ, reason: contains not printable characters */
    public int f19295;

    /* renamed from: ˆʜٴᵿ, reason: contains not printable characters */
    public AbstractC1559 f19296;

    /* renamed from: ˆᵪᵵ, reason: contains not printable characters */
    public boolean f19297;

    /* renamed from: ˆᵴᵜˏ, reason: contains not printable characters */
    public float f19298;

    /* renamed from: ˆᵼᵷˊ, reason: contains not printable characters */
    public final float f19299;

    /* renamed from: ˈᵫˊˉ, reason: contains not printable characters */
    public long f19300;

    /* renamed from: ˉʽʾ, reason: contains not printable characters */
    public boolean f19301;

    /* renamed from: ˉʾˈˊ, reason: contains not printable characters */
    public C0397 f19302;

    /* renamed from: ˉᵴﹶ, reason: contains not printable characters */
    public boolean f19303;

    /* renamed from: ˊʽˎ, reason: contains not printable characters */
    public final MediaCodec.BufferInfo f19304;

    /* renamed from: ˊʾˊ, reason: contains not printable characters */
    public C3446 f19305;

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public final InterfaceC2491 f19306;

    /* renamed from: ˌᵪ, reason: contains not printable characters */
    public final C2441 f19307;

    /* renamed from: ˌᵹᵨˑ, reason: contains not printable characters */
    public InterfaceC1660 f19308;

    /* renamed from: ˎᵬˀ, reason: contains not printable characters */
    public final ArrayDeque f19309;

    /* renamed from: ˎᵶᵹ, reason: contains not printable characters */
    public ByteBuffer f19310;

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public final InterfaceC2147 f19311;

    /* renamed from: ᐧʼ, reason: contains not printable characters */
    public long f19312;

    /* renamed from: ᵎʾ, reason: contains not printable characters */
    public boolean f19313;

    /* renamed from: ᵔᵨ, reason: contains not printable characters */
    public int f19314;

    /* renamed from: ᵖᵖˊ, reason: contains not printable characters */
    public boolean f19315;

    /* renamed from: ᵛˈᵤ, reason: contains not printable characters */
    public final C2441 f19316;

    /* renamed from: ᵛˎ, reason: contains not printable characters */
    public boolean f19317;

    /* renamed from: ᵠᵪˀᵻ, reason: contains not printable characters */
    public MediaCodecRenderer$DecoderInitializationException f19318;

    /* renamed from: ᵠᵳ, reason: contains not printable characters */
    public boolean f19319;

    /* renamed from: ᵠᵿː, reason: contains not printable characters */
    public C4418 f19320;

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public final Context f19321;

    /* renamed from: ᵡᵶᵡ, reason: contains not printable characters */
    public final C3292 f19322;

    /* renamed from: ᵣᵟᵔ, reason: contains not printable characters */
    public C3446 f19323;

    /* renamed from: ᵤʟᵟ, reason: contains not printable characters */
    public long f19324;

    /* renamed from: ᵤᵼˑʠ, reason: contains not printable characters */
    public float f19325;

    /* renamed from: ᵥʩᵩˑ, reason: contains not printable characters */
    public MediaFormat f19326;

    /* renamed from: ᵦᵳˎ, reason: contains not printable characters */
    public long f19327;

    /* renamed from: ᵦᵽᵢ, reason: contains not printable characters */
    public int f19328;

    /* renamed from: ᵨٴ, reason: contains not printable characters */
    public float f19329;

    /* renamed from: ᵪᵛʿ, reason: contains not printable characters */
    public boolean f19330;

    /* renamed from: ᵫᵮʾ, reason: contains not printable characters */
    public final C3513 f19331;

    /* renamed from: ᵭˇʾ, reason: contains not printable characters */
    public C5235 f19332;

    /* renamed from: ᵮᴵˊ, reason: contains not printable characters */
    public boolean f19333;

    /* renamed from: ᵯᵽ, reason: contains not printable characters */
    public boolean f19334;

    /* renamed from: ᵰʖʢ, reason: contains not printable characters */
    public int f19335;

    /* renamed from: ᵰᵷᵹˆ, reason: contains not printable characters */
    public boolean f19336;

    /* renamed from: ᵱˑᵲ, reason: contains not printable characters */
    public int f19337;

    /* renamed from: ᵲʟᵹ, reason: contains not printable characters */
    public boolean f19338;

    /* renamed from: ᵲᵟ, reason: contains not printable characters */
    public boolean f19339;

    /* renamed from: ᵲᵰⁱ, reason: contains not printable characters */
    public C4779 f19340;

    /* renamed from: ᵲᵳ, reason: contains not printable characters */
    public ExoPlaybackException f19341;

    /* renamed from: ᵳʼ, reason: contains not printable characters */
    public boolean f19342;

    /* renamed from: ᵳᵮ, reason: contains not printable characters */
    public boolean f19343;

    /* renamed from: ᵳᵮᵸ, reason: contains not printable characters */
    public int f19344;

    /* renamed from: ᵳᵹᵺˋ, reason: contains not printable characters */
    public final C2441 f19345;

    /* renamed from: ᵴᵯᵴⁱ, reason: contains not printable characters */
    public long f19346;

    /* renamed from: ᵷʚᵶᵿ, reason: contains not printable characters */
    public boolean f19347;

    /* renamed from: ᵷᵦﹳ, reason: contains not printable characters */
    public boolean f19348;

    /* renamed from: ᵷᵱ, reason: contains not printable characters */
    public InterfaceC1660 f19349;

    /* renamed from: ᵺᵜᵰ, reason: contains not printable characters */
    public boolean f19350;

    /* renamed from: ᵺᵠ, reason: contains not printable characters */
    public final long f19351;

    /* renamed from: ᵺᵫ, reason: contains not printable characters */
    public boolean f19352;

    /* renamed from: ᵽʛ, reason: contains not printable characters */
    public final AtomicInteger f19353;

    /* renamed from: ﹶـ, reason: contains not printable characters */
    public InterfaceC4316 f19354;

    public AbstractC5180(Context context, int i, InterfaceC2147 interfaceC2147, InterfaceC2491 interfaceC2491, boolean z, float f) {
        super(i);
        this.f19321 = context.getApplicationContext();
        this.f19311 = interfaceC2147;
        interfaceC2491.getClass();
        this.f19306 = interfaceC2491;
        this.f19293 = z;
        this.f19299 = f;
        this.f19353 = new AtomicInteger();
        this.f19316 = new C2441(0, 0);
        this.f19307 = new C2441(0, 0);
        this.f19345 = new C2441(2, 0);
        C3292 c3292 = new C3292(2, 0);
        c3292.f12336 = 32;
        this.f19322 = c3292;
        this.f19304 = new MediaCodec.BufferInfo();
        this.f19325 = 1.0f;
        this.f19298 = 1.0f;
        this.f19351 = -9223372036854775807L;
        this.f19309 = new ArrayDeque();
        this.f19332 = C5235.f19607;
        c3292.m6222(0);
        c3292.f9517.order(ByteOrder.nativeOrder());
        C3513 c3513 = new C3513();
        c3513.f13184 = InterfaceC0240.f1780;
        c3513.f13182 = 0;
        c3513.f13183 = 2;
        this.f19331 = c3513;
        this.f19329 = -1.0f;
        this.f19335 = 0;
        this.f19314 = 0;
        this.f19344 = -1;
        this.f19295 = -1;
        this.f19327 = -9223372036854775807L;
        this.f19324 = -9223372036854775807L;
        this.f19300 = -9223372036854775807L;
        this.f19346 = -9223372036854775807L;
        this.f19328 = 0;
        this.f19337 = 0;
        this.f19340 = new C4779();
        this.f19301 = false;
        this.f19312 = 0L;
        int i2 = AbstractC1559.f6211;
        this.f19296 = C5065.f18921;
        C0397 c0397 = C0397.f2263;
        this.f19289 = c0397;
        this.f19302 = c0397;
    }

    /* renamed from: ʽᵢˊ, reason: contains not printable characters */
    public final void m10681() {
        this.f19324 = -9223372036854775807L;
        m10690().f19609 = -9223372036854775807L;
        this.f19300 = -9223372036854775807L;
        this.f19338 = false;
        this.f19322.mo6221();
        this.f19345.mo6221();
        this.f19297 = false;
        C3513 c3513 = this.f19331;
        c3513.getClass();
        c3513.f13184 = InterfaceC0240.f1780;
        c3513.f13182 = 0;
        c3513.f13183 = 2;
    }

    /* renamed from: ʾˋˊᵽ, reason: contains not printable characters */
    public final void m10682(C5235 c5235) {
        this.f19332 = c5235;
        long j = c5235.f19610;
        if (j != -9223372036854775807L) {
            this.f19343 = true;
            mo10683(j);
        }
    }

    /* renamed from: ʾᵻᵭٴ, reason: contains not printable characters */
    public void mo10683(long j) {
    }

    /* renamed from: ʿᵘˆ, reason: contains not printable characters */
    public final void m10684() {
        m10704();
        this.f19341 = null;
        this.f19287 = null;
        this.f19291 = null;
        this.f19323 = null;
        this.f19326 = null;
        this.f19339 = false;
        this.f19317 = false;
        this.f19329 = -1.0f;
        this.f19335 = 0;
        this.f19288 = false;
        this.f19350 = false;
        this.f19303 = false;
        this.f19330 = false;
        this.f19336 = false;
        this.f19314 = 0;
    }

    /* renamed from: ˀˁᵨ, reason: contains not printable characters */
    public abstract void mo10685(long j, long j2, String str);

    @Override // defpackage.AbstractC4483
    /* renamed from: ˀᵗᵝᵭ */
    public final int mo372(C3446 c3446) throws ExoPlaybackException {
        try {
            return mo10714(this.f19306, c3446);
        } catch (MediaCodecUtil$DecoderQueryException e) {
            throw this.m9539(e, c3446, false, 4002);
        }
    }

    /* renamed from: ˀᵗᵩ, reason: contains not printable characters */
    public long mo10686(long j, long j2, boolean z) {
        return super.mo395(j, j2);
    }

    /* JADX WARN: Removed duplicated region for block: B:17:0x0032  */
    /* JADX WARN: Removed duplicated region for block: B:23:0x0049  */
    /* renamed from: ˁˑᵰ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean m10687() throws android.media.MediaCryptoException, androidx.media3.exoplayer.ExoPlaybackException {
        /*
            Method dump skipped, instructions count: 483
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.AbstractC5180.m10687():boolean");
    }

    /* renamed from: ˆʕ, reason: contains not printable characters */
    public final void m10688(long j) {
        C3446 c3446 = (C3446) this.f19332.f19613.m8756(j);
        if (c3446 == null && this.f19343 && this.f19326 != null) {
            c3446 = (C3446) this.f19332.f19613.m8753();
        }
        if (c3446 != null) {
            this.f19305 = c3446;
        } else if (!this.f19339 || this.f19305 == null) {
            return;
        }
        C3446 c34462 = this.f19305;
        c34462.getClass();
        mo10705(c34462, this.f19326);
        this.f19339 = false;
        this.f19343 = false;
    }

    /* renamed from: ˆᵴᵜˏ, reason: contains not printable characters */
    public void m10689(C2441 c2441) {
    }

    /* renamed from: ˆᵼᵷˊ, reason: contains not printable characters */
    public final C5235 m10690() {
        ArrayDeque arrayDeque = this.f19309;
        return !arrayDeque.isEmpty() ? (C5235) arrayDeque.getLast() : this.f19332;
    }

    /* renamed from: ˉᵴﹶ, reason: contains not printable characters */
    public boolean m10691() throws MediaCryptoException {
        int i = this.f19337;
        if (i == 3 || ((this.f19288 && !this.f19317) || (this.f19350 && this.f19352))) {
            return true;
        }
        if (i != 2) {
            return false;
        }
        try {
            m10719();
            return false;
        } catch (ExoPlaybackException e) {
            ᵳʿˉ.ˁˑᵰ("Failed to update the DRM session, releasing the codec instead.", e);
            return true;
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:38:0x0084  */
    /* JADX WARN: Removed duplicated region for block: B:59:0x00c5  */
    /* renamed from: ˊʽˎ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void m10692() throws androidx.media3.exoplayer.ExoPlaybackException {
        /*
            Method dump skipped, instructions count: 226
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.AbstractC5180.m10692():void");
    }

    /* renamed from: ˊʾˊ, reason: contains not printable characters */
    public abstract void mo10693(C0397 c0397);

    /* renamed from: ˊᵸˊ, reason: contains not printable characters */
    public abstract ArrayList mo10694(InterfaceC2491 interfaceC2491, C3446 c3446, boolean z);

    @Override // defpackage.AbstractC4483
    /* renamed from: ˌʾˀ */
    public void mo374(long j, boolean z, boolean z2) throws ExoPlaybackException {
        ArrayDeque arrayDeque = this.f19309;
        if (!arrayDeque.isEmpty()) {
            this.f19332 = (C5235) arrayDeque.getLast();
        }
        arrayDeque.clear();
        if (z2) {
            this.f19286 = false;
            this.f19319 = false;
            this.f19342 = false;
            if (this.f19333) {
                m10681();
            } else if (this.f19354 != null) {
                if (m10691()) {
                    m10718();
                    m10692();
                } else if (m10701()) {
                    m10730();
                } else {
                    this.f19301 = true;
                }
            }
            if (this.f19332.f19613.m8751() > 0) {
                this.f19347 = true;
            }
            this.f19332.f19613.m8759();
            this.f19332.f19608 = false;
        }
    }

    /* renamed from: ˌᵪ, reason: contains not printable characters */
    public abstract void mo10695(C2441 c2441);

    /* JADX WARN: Code restructure failed: missing block: B:75:0x0111, code lost:
    
        if (r4.mo4741(r2) != false) goto L140;
     */
    /* JADX WARN: Removed duplicated region for block: B:12:0x0032  */
    /* JADX WARN: Removed duplicated region for block: B:32:0x0063  */
    /* JADX WARN: Removed duplicated region for block: B:93:0x0145  */
    /* renamed from: ˌᵹᵨˑ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public defpackage.C3767 mo10696(defpackage.C2720 r15) throws androidx.media3.exoplayer.ExoPlaybackException {
        /*
            Method dump skipped, instructions count: 486
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.AbstractC5180.mo10696(ᵛʾᵼ):ᵨᵸᵣᵛ");
    }

    /* renamed from: ˎˑː, reason: contains not printable characters */
    public final void m10697(MediaFormat mediaFormat) {
        if (Build.VERSION.SDK_INT >= 29) {
            for (Map.Entry entry : this.f19289.f2264.entrySet()) {
                String str = (String) entry.getKey();
                Object value = entry.getValue();
                if (value == null) {
                    mediaFormat.setString(str, null);
                } else if (value instanceof Integer) {
                    mediaFormat.setInteger(str, ((Integer) value).intValue());
                } else if (value instanceof Long) {
                    mediaFormat.setLong(str, ((Long) value).longValue());
                } else if (value instanceof Float) {
                    mediaFormat.setFloat(str, ((Float) value).floatValue());
                } else if (value instanceof String) {
                    mediaFormat.setString(str, (String) value);
                } else if (value instanceof ByteBuffer) {
                    mediaFormat.setByteBuffer(str, (ByteBuffer) value);
                }
            }
        }
    }

    /* renamed from: ˎᵬˀ, reason: contains not printable characters */
    public final void m10698(MediaCrypto mediaCrypto, boolean z) throws MediaCodecRenderer$DecoderInitializationException {
        C3446 c3446 = this.f19292;
        c3446.getClass();
        if (this.f19287 == null) {
            try {
                List listM10702 = m10702(z);
                ArrayDeque arrayDeque = new ArrayDeque();
                this.f19287 = arrayDeque;
                if (this.f19293) {
                    arrayDeque.addAll(listM10702);
                } else {
                    ArrayList arrayList = (ArrayList) listM10702;
                    if (!arrayList.isEmpty()) {
                        this.f19287.add((C0381) arrayList.get(0));
                    }
                }
                this.f19318 = null;
            } catch (MediaCodecUtil$DecoderQueryException e) {
                throw new MediaCodecRenderer$DecoderInitializationException(c3446, e, z, -49998);
            }
        }
        if (this.f19287.isEmpty()) {
            throw new MediaCodecRenderer$DecoderInitializationException(c3446, null, z, -49999);
        }
        ArrayDeque arrayDeque2 = this.f19287;
        arrayDeque2.getClass();
        while (this.f19354 == null) {
            C0381 c0381 = (C0381) arrayDeque2.peekFirst();
            c0381.getClass();
            if (!m10715(c3446) || !m10723(c0381)) {
                return;
            }
            try {
                m10720(c0381, mediaCrypto);
            } catch (Exception e2) {
                ᵳʿˉ.ˁˑᵰ("Failed to initialize decoder: " + c0381, e2);
                arrayDeque2.removeFirst();
                MediaCodecRenderer$DecoderInitializationException mediaCodecRenderer$DecoderInitializationException = new MediaCodecRenderer$DecoderInitializationException("Decoder init failed: " + c0381.f2185 + ", " + c3446, e2, c3446.f12929, z, c0381, e2 instanceof MediaCodec.CodecException ? ((MediaCodec.CodecException) e2).getDiagnosticInfo() : null);
                mo10728(mediaCodecRenderer$DecoderInitializationException);
                MediaCodecRenderer$DecoderInitializationException mediaCodecRenderer$DecoderInitializationException2 = this.f19318;
                if (mediaCodecRenderer$DecoderInitializationException2 == null) {
                    this.f19318 = mediaCodecRenderer$DecoderInitializationException;
                } else {
                    this.f19318 = new MediaCodecRenderer$DecoderInitializationException(mediaCodecRenderer$DecoderInitializationException2.getMessage(), mediaCodecRenderer$DecoderInitializationException2.getCause(), mediaCodecRenderer$DecoderInitializationException2.f649, mediaCodecRenderer$DecoderInitializationException2.f648, mediaCodecRenderer$DecoderInitializationException2.f651, mediaCodecRenderer$DecoderInitializationException2.f650);
                }
                if (arrayDeque2.isEmpty()) {
                    throw this.f19318;
                }
            }
        }
        this.f19287 = null;
    }

    @Override // defpackage.AbstractC4483, defpackage.InterfaceC1822
    /* renamed from: ˏᵙ */
    public void mo379(int i, Object obj) {
        int i2;
        if (i == 11) {
            C4418 c4418 = (C4418) obj;
            c4418.getClass();
            this.f19320 = c4418;
            return;
        }
        if (i != 21) {
            if (i == 22 && (i2 = Build.VERSION.SDK_INT) >= 29) {
                obj.getClass();
                AbstractC1559 abstractC1559 = (AbstractC1559) obj;
                if (this.f19296.equals(abstractC1559)) {
                    return;
                }
                if (i2 >= 31) {
                    HashSet hashSet = new HashSet(abstractC1559);
                    HashSet hashSet2 = new HashSet();
                    AbstractC5447 it = this.f19296.iterator();
                    while (it.hasNext()) {
                        String str = (String) it.next();
                        if (!hashSet.remove(str)) {
                            hashSet2.add(str);
                        }
                    }
                    InterfaceC4316 interfaceC4316 = this.f19354;
                    if (interfaceC4316 != null) {
                        if (!hashSet2.isEmpty()) {
                            interfaceC4316.mo5748(new ArrayList(hashSet2));
                        }
                        if (!hashSet.isEmpty()) {
                            interfaceC4316.mo5750(new ArrayList(hashSet));
                        }
                    }
                }
                this.f19296 = abstractC1559;
                return;
            }
            return;
        }
        if (Build.VERSION.SDK_INT >= 29) {
            obj.getClass();
            C0397 c0397 = (C0397) obj;
            this.f19289 = c0397;
            InterfaceC4316 interfaceC43162 = this.f19354;
            if (interfaceC43162 != null) {
                Bundle bundle = new Bundle();
                for (Map.Entry entry : c0397.f2264.entrySet()) {
                    String str2 = (String) entry.getKey();
                    Object value = entry.getValue();
                    if (value != null) {
                        if (value instanceof Integer) {
                            bundle.putInt(str2, ((Integer) value).intValue());
                        } else if (value instanceof Long) {
                            bundle.putLong(str2, ((Long) value).longValue());
                        } else if (value instanceof Float) {
                            bundle.putFloat(str2, ((Float) value).floatValue());
                        } else if (value instanceof String) {
                            bundle.putString(str2, (String) value);
                        } else if (value instanceof ByteBuffer) {
                            ByteBuffer byteBuffer = (ByteBuffer) value;
                            byte[] bArr = new byte[byteBuffer.remaining()];
                            byteBuffer.duplicate().get(bArr);
                            bundle.putByteArray(str2, bArr);
                        }
                    }
                }
                interfaceC43162.mo5747(bundle);
            }
        }
    }

    /* renamed from: ˑᵝﹳᵜ, reason: contains not printable characters */
    public abstract float mo10699(float f, C3446 c3446, C3446[] c3446Arr);

    /* JADX WARN: Code restructure failed: missing block: B:15:0x003a, code lost:
    
        if (r4 >= r0) goto L16;
     */
    @Override // defpackage.AbstractC4483
    /* renamed from: ˑᵱ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void mo380(defpackage.C3446[] r12, long r13, long r15, defpackage.C2477 r17) {
        /*
            r11 = this;
            ᵻⁱᵨ r12 = r11.f19332
            long r0 = r12.f19610
            r2 = -9223372036854775807(0x8000000000000001, double:-4.9E-324)
            int r12 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))
            if (r12 != 0) goto L24
            ᵻⁱᵨ r4 = new ᵻⁱᵨ
            r5 = -9223372036854775807(0x8000000000000001, double:-4.9E-324)
            r7 = r13
            r9 = r15
            r4.<init>(r5, r7, r9)
            r11.m10682(r4)
            boolean r12 = r11.f19315
            if (r12 == 0) goto L56
            r11.mo10709()
            return
        L24:
            java.util.ArrayDeque r12 = r11.f19309
            boolean r0 = r12.isEmpty()
            if (r0 == 0) goto L57
            long r0 = r11.f19324
            int r4 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1))
            if (r4 == 0) goto L3c
            long r4 = r11.f19300
            int r6 = (r4 > r2 ? 1 : (r4 == r2 ? 0 : -1))
            if (r6 == 0) goto L57
            int r0 = (r4 > r0 ? 1 : (r4 == r0 ? 0 : -1))
            if (r0 < 0) goto L57
        L3c:
            ᵻⁱᵨ r4 = new ᵻⁱᵨ
            r5 = -9223372036854775807(0x8000000000000001, double:-4.9E-324)
            r7 = r13
            r9 = r15
            r4.<init>(r5, r7, r9)
            r11.m10682(r4)
            ᵻⁱᵨ r12 = r11.f19332
            long r12 = r12.f19610
            int r12 = (r12 > r2 ? 1 : (r12 == r2 ? 0 : -1))
            if (r12 == 0) goto L56
            r11.mo10709()
        L56:
            return
        L57:
            ᵻⁱᵨ r0 = new ᵻⁱᵨ
            long r1 = r11.f19324
            r3 = r13
            r5 = r15
            r0.<init>(r1, r3, r5)
            r12.add(r0)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.AbstractC5180.mo380(ᵤᵛᵖ[], long, long, ᵗᵱ):void");
    }

    /* renamed from: ᐧﾞ, reason: contains not printable characters */
    public final boolean m10700() throws MediaCryptoException, ExoPlaybackException {
        if (!this.f19294) {
            m10719();
            return true;
        }
        this.f19328 = 1;
        if (this.f19350) {
            this.f19337 = 3;
            return false;
        }
        this.f19337 = 2;
        return true;
    }

    /* renamed from: ᵎʾ, reason: contains not printable characters */
    public boolean m10701() {
        return true;
    }

    /* renamed from: ᵙᵢᵨᵳ, reason: contains not printable characters */
    public final List m10702(boolean z) {
        C3446 c3446 = this.f19292;
        c3446.getClass();
        InterfaceC2491 interfaceC2491 = this.f19306;
        ArrayList arrayListMo10694 = mo10694(interfaceC2491, c3446, z);
        if (!arrayListMo10694.isEmpty() || !z) {
            return arrayListMo10694;
        }
        ArrayList arrayListMo106942 = mo10694(interfaceC2491, c3446, false);
        if (!arrayListMo106942.isEmpty()) {
            ᵳʿˉ.ᵶʔᵢˊ("Drm session requires secure decoder for " + c3446.f12929 + ", but no secure decoder available. Trying to proceed with " + arrayListMo106942 + ".");
        }
        return arrayListMo106942;
    }

    /* renamed from: ᵛˈᵤ, reason: contains not printable characters */
    public abstract C3460 mo10703(C0381 c0381, C3446 c3446, MediaCrypto mediaCrypto, float f);

    /* renamed from: ᵠᵪˀᵻ, reason: contains not printable characters */
    public void m10704() {
        this.f19344 = -1;
        this.f19307.f9517 = null;
        this.f19295 = -1;
        this.f19310 = null;
        this.f19324 = -9223372036854775807L;
        m10690().f19609 = -9223372036854775807L;
        this.f19300 = -9223372036854775807L;
        this.f19327 = -9223372036854775807L;
        this.f19352 = false;
        this.f19346 = -9223372036854775807L;
        this.f19294 = false;
        this.f19313 = false;
        this.f19348 = false;
        this.f19334 = false;
        this.f19328 = 0;
        this.f19337 = 0;
        this.f19314 = this.f19336 ? 1 : 0;
        this.f19301 = false;
        this.f19312 = 0L;
    }

    /* renamed from: ᵠᵿː, reason: contains not printable characters */
    public abstract void mo10705(C3446 c3446, MediaFormat mediaFormat);

    @Override // defpackage.AbstractC4483
    /* renamed from: ᵡˎ */
    public final int mo384() {
        return 8;
    }

    /* renamed from: ᵡᵘˎʽ, reason: contains not printable characters */
    public int m10706(C2441 c2441) {
        return 0;
    }

    /* renamed from: ᵡᵶᵡ, reason: contains not printable characters */
    public final boolean m10707(long j, long j2) {
        if (j2 >= j) {
            return false;
        }
        C3446 c3446 = this.f19305;
        return c3446 == null || !Objects.equals(c3446.f12929, "audio/opus") || j - j2 > 80000;
    }

    @Override // defpackage.AbstractC4483
    /* renamed from: ᵡⁱᵥ */
    public void mo9534(float f, float f2) throws ExoPlaybackException {
        this.f19325 = f;
        this.f19298 = f2;
        m10711(this.f19323);
    }

    /* renamed from: ᵣᵟᵔ, reason: contains not printable characters */
    public abstract boolean mo10708(long j, long j2, InterfaceC4316 interfaceC4316, ByteBuffer byteBuffer, int i, int i2, int i3, long j3, boolean z, boolean z2, C3446 c3446);

    /* renamed from: ᵤᵼˑʠ, reason: contains not printable characters */
    public abstract void mo10709();

    /* renamed from: ᵥʩᵩˑ, reason: contains not printable characters */
    public final boolean m10710(int i) throws MediaCryptoException, ExoPlaybackException {
        C2720 c2720 = this.f16732;
        c2720.m6736();
        C2441 c2441 = this.f19316;
        c2441.mo6221();
        int iM9535 = m9535(c2720, c2441, i | 4);
        if (iM9535 == -5) {
            mo10696(c2720);
            return true;
        }
        if (iM9535 != -4 || !c2441.m9873(4)) {
            return false;
        }
        this.f19286 = true;
        m10729();
        return false;
    }

    /* renamed from: ᵦᵳˎ, reason: contains not printable characters */
    public final boolean m10711(C3446 c3446) throws ExoPlaybackException {
        if (this.f19354 != null && this.f19337 != 3 && this.f16722 != 0) {
            float f = this.f19298;
            c3446.getClass();
            C3446[] c3446Arr = this.f16718;
            c3446Arr.getClass();
            float fMo10699 = mo10699(f, c3446, c3446Arr);
            float f2 = this.f19329;
            if (f2 != fMo10699) {
                if (fMo10699 == -1.0f) {
                    if (this.f19294) {
                        this.f19328 = 1;
                        this.f19337 = 3;
                        return false;
                    }
                    m10718();
                    m10692();
                    return false;
                }
                if (f2 != -1.0f || fMo10699 > this.f19299) {
                    Bundle bundle = new Bundle();
                    bundle.putFloat("operating-rate", fMo10699);
                    InterfaceC4316 interfaceC4316 = this.f19354;
                    interfaceC4316.getClass();
                    interfaceC4316.mo5747(bundle);
                    this.f19329 = fMo10699;
                }
            }
        }
        return true;
    }

    /* renamed from: ᵧـˌᵎ, reason: contains not printable characters */
    public abstract C3767 mo10712(C0381 c0381, C3446 c3446, C3446 c34462, boolean z);

    /* renamed from: ᵨٴ, reason: contains not printable characters */
    public abstract void mo10713();

    @Override // defpackage.AbstractC4483
    /* renamed from: ᵪʩ */
    public void mo388() {
        this.f19292 = null;
        m10682(C5235.f19607);
        this.f19309.clear();
        if (this.f19333) {
            this.f19333 = false;
            m10681();
        } else {
            if (this.f19354 == null) {
                return;
            }
            if (m10691()) {
                m10718();
            } else if (m10701()) {
                m10730();
            } else {
                this.f19301 = true;
            }
        }
    }

    /* renamed from: ᵪᵛʿ, reason: contains not printable characters */
    public abstract int mo10714(InterfaceC2491 interfaceC2491, C3446 c3446);

    /* renamed from: ᵫᵮʾ, reason: contains not printable characters */
    public boolean m10715(C3446 c3446) {
        return true;
    }

    /* JADX WARN: Removed duplicated region for block: B:107:0x02f3  */
    /* JADX WARN: Removed duplicated region for block: B:110:0x02fb  */
    /* JADX WARN: Removed duplicated region for block: B:111:0x02fe  */
    /* renamed from: ᵮᵠـˌ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final boolean m10716(long r25, long r27) throws androidx.media3.exoplayer.ExoPlaybackException {
        /*
            Method dump skipped, instructions count: 824
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.AbstractC5180.m10716(long, long):boolean");
    }

    /* renamed from: ᵰʖʢ, reason: contains not printable characters */
    public final void m10717(InterfaceC1660 interfaceC1660) {
        AbstractC4486.m9554(this.f19349, interfaceC1660);
        this.f19349 = interfaceC1660;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* renamed from: ᵲᵟ, reason: contains not printable characters */
    public final void m10718() {
        try {
            InterfaceC4316 interfaceC4316 = this.f19354;
            if (interfaceC4316 != null) {
                interfaceC4316.mo5752();
                this.f19340.f17758++;
                C0381 c0381 = this.f19291;
                c0381.getClass();
                mo10724(c0381.f2185);
            }
            this.f19354 = null;
            try {
                MediaCrypto mediaCrypto = this.f19290;
                if (mediaCrypto != null) {
                    mediaCrypto.release();
                }
            } finally {
            }
        } catch (Throwable th) {
            this.f19354 = null;
            try {
                MediaCrypto mediaCrypto2 = this.f19290;
                if (mediaCrypto2 != null) {
                    mediaCrypto2.release();
                }
                throw th;
            } finally {
            }
        }
    }

    /* renamed from: ᵳᵮᵸ, reason: contains not printable characters */
    public final void m10719() throws MediaCryptoException, ExoPlaybackException {
        InterfaceC1660 interfaceC1660 = this.f19308;
        interfaceC1660.getClass();
        C4641 c4641Mo4745 = interfaceC1660.mo4745();
        if (c4641Mo4745 != null) {
            try {
                MediaCrypto mediaCrypto = this.f19290;
                mediaCrypto.getClass();
                mediaCrypto.setMediaDrmSession(c4641Mo4745.f17195);
            } catch (MediaCryptoException e) {
                throw m9539(e, this.f19292, false, 6006);
            }
        }
        m10717(this.f19308);
        this.f19328 = 0;
        this.f19337 = 0;
    }

    /* JADX WARN: Removed duplicated region for block: B:25:0x00cc  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x0104  */
    /* renamed from: ᵳᵹᵺˋ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void m10720(defpackage.C0381 r13, android.media.MediaCrypto r14) {
        /*
            Method dump skipped, instructions count: 455
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.AbstractC5180.m10720(ʿˁᵽ, android.media.MediaCrypto):void");
    }

    /* renamed from: ᵴᵯᵴⁱ, reason: contains not printable characters */
    public boolean mo10721(C3446 c3446) {
        return false;
    }

    /* renamed from: ᵶʔᵢˊ, reason: contains not printable characters */
    public final boolean m10722(long j, long j2) throws MediaCryptoException, ExoPlaybackException {
        InterfaceC4316 interfaceC4316 = this.f19354;
        interfaceC4316.getClass();
        int i = this.f19295;
        MediaCodec.BufferInfo bufferInfo = this.f19304;
        if (i < 0) {
            int iMo5744 = interfaceC4316.mo5744(bufferInfo);
            if (iMo5744 < 0) {
                if (iMo5744 != -2) {
                    if (this.f19303 && (this.f19286 || this.f19328 == 2)) {
                        m10729();
                    }
                    long j3 = this.f19346;
                    if (j3 != -9223372036854775807L) {
                        long j4 = j3 + 100;
                        this.f16716.getClass();
                        if (j4 < System.currentTimeMillis()) {
                            m10729();
                            return false;
                        }
                    }
                    return false;
                }
                this.f19317 = true;
                InterfaceC4316 interfaceC43162 = this.f19354;
                interfaceC43162.getClass();
                MediaFormat mediaFormatMo5760 = interfaceC43162.mo5760();
                if (this.f19335 != 0 && mediaFormatMo5760.getInteger("width") == 32 && mediaFormatMo5760.getInteger("height") == 32) {
                    this.f19348 = true;
                    return true;
                }
                if (Build.VERSION.SDK_INT >= 29 && !this.f19296.isEmpty()) {
                    C0397 c0397 = new C0397((HashMap) C0397.m1870(mediaFormatMo5760, this.f19296).ᵢˇᵭ);
                    if (!c0397.equals(this.f19302)) {
                        this.f19302 = c0397;
                        mo10693(c0397);
                    }
                }
                this.f19326 = mediaFormatMo5760;
                this.f19339 = true;
                return true;
            }
            bufferInfo.presentationTimeUs -= this.f19312;
            if (this.f19348) {
                this.f19348 = false;
                interfaceC4316.mo5745(iMo5744);
                return true;
            }
            if (bufferInfo.size == 0 && (bufferInfo.flags & 4) != 0) {
                m10729();
                return false;
            }
            this.f19295 = iMo5744;
            ByteBuffer byteBufferMo5758 = interfaceC4316.mo5758(iMo5744);
            this.f19310 = byteBufferMo5758;
            if (byteBufferMo5758 != null) {
                byteBufferMo5758.position(bufferInfo.offset);
                this.f19310.limit(bufferInfo.offset + bufferInfo.size);
            }
            m10688(bufferInfo.presentationTimeUs);
        }
        boolean z = this.f19301 || bufferInfo.presentationTimeUs < this.f16726;
        long j5 = this.f19332.f19609;
        boolean z2 = j5 != -9223372036854775807L && j5 <= bufferInfo.presentationTimeUs;
        this.f19334 = z2;
        ByteBuffer byteBuffer = this.f19310;
        int i2 = this.f19295;
        int i3 = bufferInfo.flags;
        long j6 = bufferInfo.presentationTimeUs;
        C3446 c3446 = this.f19305;
        c3446.getClass();
        if (!mo10708(j, j2, interfaceC4316, byteBuffer, i2, i3, 1, j6, z, z2, c3446)) {
            return false;
        }
        m10727(bufferInfo.presentationTimeUs);
        boolean z3 = (bufferInfo.flags & 4) != 0;
        if (!z3 && this.f19352 && this.f19334) {
            this.f16716.getClass();
            this.f19346 = System.currentTimeMillis();
        }
        this.f19295 = -1;
        this.f19310 = null;
        if (!z3) {
            return true;
        }
        m10729();
        return false;
    }

    /* renamed from: ᵷᵦﹳ, reason: contains not printable characters */
    public boolean m10723(C0381 c0381) {
        return true;
    }

    /* renamed from: ᵷᵱ, reason: contains not printable characters */
    public abstract void mo10724(String str);

    @Override // defpackage.AbstractC4483
    /* renamed from: ᵹᵝᵶ */
    public final long mo395(long j, long j2) {
        return mo10686(j, j2, this.f19330);
    }

    /* renamed from: ᵺʙ, reason: contains not printable characters */
    public MediaCodecDecoderException m10725(IllegalStateException illegalStateException, C0381 c0381) {
        return new MediaCodecDecoderException(illegalStateException, c0381);
    }

    /* renamed from: ᵺᵜᵰ, reason: contains not printable characters */
    public boolean m10726(C2441 c2441) {
        return false;
    }

    /* renamed from: ᵺᵠ, reason: contains not printable characters */
    public void m10727(long j) {
        this.f19300 = j;
        while (true) {
            ArrayDeque arrayDeque = this.f19309;
            if (arrayDeque.isEmpty() || j < ((C5235) arrayDeque.peek()).f19611) {
                return;
            }
            C5235 c5235 = (C5235) arrayDeque.poll();
            c5235.getClass();
            m10682(c5235);
            mo10709();
        }
    }

    /* renamed from: ᵽʛ, reason: contains not printable characters */
    public abstract void mo10728(Exception exc);

    /* JADX WARN: Removed duplicated region for block: B:41:0x0078 A[LOOP:1: B:31:0x0053->B:41:0x0078, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:52:0x0099 A[LOOP:2: B:42:0x0079->B:52:0x0099, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:87:0x0079 A[EDGE_INSN: B:87:0x0079->B:90:? BREAK  A[LOOP:1: B:31:0x0053->B:41:0x0078], SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:88:0x009a A[EDGE_INSN: B:88:0x009a->B:53:0x009a BREAK  A[LOOP:2: B:42:0x0079->B:52:0x0099], SYNTHETIC] */
    @Override // defpackage.AbstractC4483
    /* renamed from: ᵿʗᵝʽ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public void mo397(long r12, long r14) throws android.media.MediaCryptoException, androidx.media3.exoplayer.ExoPlaybackException {
        /*
            Method dump skipped, instructions count: 275
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.AbstractC5180.mo397(long, long):void");
    }

    /* renamed from: ﹶـ, reason: contains not printable characters */
    public final void m10729() throws MediaCryptoException, ExoPlaybackException {
        int i = this.f19337;
        if (i == 1) {
            m10730();
            return;
        }
        if (i == 2) {
            m10730();
            m10719();
        } else if (i != 3) {
            this.f19319 = true;
            mo10713();
        } else {
            m10718();
            m10692();
        }
    }

    /* renamed from: ﾞⁱ, reason: contains not printable characters */
    public final void m10730() {
        try {
            InterfaceC4316 interfaceC4316 = this.f19354;
            interfaceC4316.getClass();
            interfaceC4316.flush();
        } finally {
            m10704();
        }
    }
}
