package defpackage;

import androidx.media3.common.ParserException;
import java.util.List;

/* renamed from: ᵼᵗᵰ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C5275 implements InterfaceC2689 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public C1797 f19739;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public int f19740;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public InterfaceC1383 f19742;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public int f19743;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public InterfaceC1982 f19745;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public long f19747;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public C3293 f19748;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C3493 f19744 = new C3493(16);

    /* renamed from: ᵶᵷᵕ, reason: contains not printable characters */
    public long f19746 = -1;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public int f19741 = 0;

    @Override // defpackage.InterfaceC2689
    /* renamed from: ˇʼʤˎ */
    public final boolean mo1572(InterfaceC1383 interfaceC1383) {
        return ˏᵭᵔᵬ.ᵨᵳʝ((C1938) interfaceC1383, true);
    }

    @Override // defpackage.InterfaceC2689
    /* renamed from: ˎˏʜʾ */
    public final void mo1573(InterfaceC1982 interfaceC1982) {
        this.f19745 = interfaceC1982;
    }

    @Override // defpackage.InterfaceC2689
    /* renamed from: ˏˋٴ */
    public final List mo1574() {
        C4421 c4421 = AbstractC2692.f10429;
        return C4471.f16684;
    }

    @Override // defpackage.InterfaceC2689
    /* renamed from: ˏᵙ */
    public final InterfaceC2689 mo1575() {
        return this;
    }

    @Override // defpackage.InterfaceC2689
    /* renamed from: ᵥᵯˎ */
    public final void mo1576() {
        C1797 c1797 = this.f19739;
        if (c1797 != null) {
            c1797.getClass();
            this.f19739 = null;
        }
    }

    @Override // defpackage.InterfaceC2689
    /* renamed from: ᵴᵳ */
    public final void mo1577(long j, long j2) {
        if (j != 0) {
            if (this.f19741 == 3) {
                C1797 c1797 = this.f19739;
                c1797.getClass();
                c1797.mo1577(j, j2);
                return;
            }
            return;
        }
        this.f19741 = 0;
        this.f19743 = 0;
        this.f19746 = -1L;
        if (this.f19739 != null) {
            this.f19739 = null;
        }
    }

    @Override // defpackage.InterfaceC2689
    /* renamed from: ᵻᵢﹳᵰ */
    public final int mo1578(InterfaceC1383 interfaceC1383, C4184 c4184) throws ParserException {
        while (true) {
            int i = this.f19741;
            if (i == 0) {
                int i2 = this.f19743;
                C3493 c3493 = this.f19744;
                if (i2 == 0) {
                    if (!interfaceC1383.mo4252(c3493.f13082, 0, 8, true)) {
                        InterfaceC1982 interfaceC1982 = this.f19745;
                        interfaceC1982.getClass();
                        interfaceC1982.mo4985();
                        this.f19745.mo4987(new C3300(-9223372036854775807L));
                        this.f19741 = 4;
                        return -1;
                    }
                    this.f19743 = 8;
                    c3493.m7955(0);
                    this.f19747 = c3493.m7954();
                    this.f19740 = c3493.m7965();
                }
                if (this.f19747 == 1) {
                    interfaceC1383.readFully(c3493.f13082, 8, 8);
                    this.f19743 += 8;
                    this.f19747 = c3493.m7960();
                }
                if (this.f19740 == 1836086884) {
                    long position = interfaceC1383.getPosition();
                    this.f19746 = position;
                    long j = this.f19743;
                    C1558 c1558 = new C1558(0L, position - j, -9223372036854775807L, position, this.f19747 - j);
                    InterfaceC1982 interfaceC19822 = this.f19745;
                    interfaceC19822.getClass();
                    InterfaceC2154 interfaceC2154Mo4996 = interfaceC19822.mo4996(1024, 4);
                    C2153 c2153 = new C2153();
                    c2153.f8518 = AbstractC2924.m7101("image/heic");
                    c2153.f8524 = new C3034(c1558);
                    AbstractC4737.m10004(c2153, interfaceC2154Mo4996);
                    this.f19741 = 2;
                } else {
                    this.f19741 = 1;
                }
            } else if (i == 1) {
                interfaceC1383.mo4248((int) (this.f19747 - this.f19743));
                this.f19743 = 0;
                this.f19741 = 0;
            } else {
                if (i != 2) {
                    if (i != 3) {
                        if (i == 4) {
                            return -1;
                        }
                        ᵨᴵᵺ.ˌʾˀ();
                        return 0;
                    }
                    if (this.f19748 == null || interfaceC1383 != this.f19742) {
                        this.f19742 = interfaceC1383;
                        this.f19748 = new C3293(interfaceC1383, this.f19746);
                    }
                    C1797 c1797 = this.f19739;
                    c1797.getClass();
                    int iMo1578 = c1797.mo1578(this.f19748, c4184);
                    if (iMo1578 == 1) {
                        c4184.f15658 += this.f19746;
                    }
                    return iMo1578;
                }
                if (this.f19739 == null) {
                    this.f19739 = new C1797(InterfaceC1889.f7610, 8);
                }
                C3293 c3293 = new C3293(interfaceC1383, this.f19746);
                this.f19748 = c3293;
                if (this.f19739.mo1572(c3293)) {
                    C1797 c17972 = this.f19739;
                    long j2 = this.f19746;
                    InterfaceC1982 interfaceC19823 = this.f19745;
                    interfaceC19823.getClass();
                    c17972.mo1573(new C3293(j2, interfaceC19823, 6));
                    this.f19741 = 3;
                } else {
                    InterfaceC1982 interfaceC19824 = this.f19745;
                    interfaceC19824.getClass();
                    interfaceC19824.mo4985();
                    this.f19745.mo4987(new C3300(-9223372036854775807L));
                    this.f19741 = 4;
                }
            }
        }
    }
}
