package p138.p176.p177.p190.p198.p207;

import p138.p176.p177.p190.C3431;
import p138.p176.p177.p190.p192.C3475;
import p138.p176.p177.p190.p198.InterfaceC3562;
import p138.p176.p177.p190.p198.InterfaceC3575;
import p138.p176.p177.p190.p198.p207.InterfaceC3690;
import p138.p176.p177.p190.p239.C4139;
import p138.p176.p177.p190.p239.C4140;

/* JADX INFO: renamed from: ދ.ހ.֏.ؠ.ೲ.ޝ.ށ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C3654 implements InterfaceC3660 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final C4139 f11079;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final C4140 f11080;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final String f11081;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public String f11082;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public InterfaceC3575 f11083;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public int f11084;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public int f11085;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public boolean f11086;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public boolean f11087;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public long f11088;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public C3431 f11089;

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public int f11090;

    /* JADX INFO: renamed from: ފ, reason: contains not printable characters */
    public long f11091;

    public C3654(String str) {
        C4139 c4139 = new C4139(new byte[16]);
        this.f11079 = c4139;
        this.f11080 = new C4140(c4139.f13223);
        this.f11084 = 0;
        this.f11085 = 0;
        this.f11086 = false;
        this.f11087 = false;
        this.f11081 = str;
    }

    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3660
    /* JADX INFO: renamed from: ֏ */
    public void mo5997() {
        this.f11084 = 0;
        this.f11085 = 0;
        this.f11086 = false;
        this.f11087 = false;
    }

    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3660
    /* JADX INFO: renamed from: ֏ */
    public void mo5998(long j, int i) {
        this.f11091 = j;
    }

    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3660
    /* JADX INFO: renamed from: ֏ */
    public void mo5999(InterfaceC3562 interfaceC3562, InterfaceC3690.C3694 c3694) {
        c3694.m6035();
        this.f11082 = c3694.m6036();
        this.f11083 = interfaceC3562.mo5891(c3694.m6037(), 1);
    }

    /* JADX WARN: Code restructure failed: missing block: B:44:0x0104, code lost:
    
        if (r2 != 65) goto L46;
     */
    /* JADX WARN: Code restructure failed: missing block: B:45:0x0106, code lost:
    
        r2 = true;
     */
    /* JADX WARN: Code restructure failed: missing block: B:46:0x0108, code lost:
    
        r2 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:47:0x0109, code lost:
    
        r20.f11087 = r2;
        r2 = true;
     */
    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3660
    /* JADX INFO: renamed from: ֏ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void mo6000(C4140 c4140) {
        boolean z;
        while (c4140.m6679() > 0) {
            int i = this.f11084;
            if (i == 0) {
                while (true) {
                    if (c4140.m6679() <= 0) {
                        z = false;
                        break;
                    } else if (this.f11086) {
                        int iM6702 = c4140.m6702();
                        this.f11086 = iM6702 == 172;
                        if (iM6702 == 64 || iM6702 == 65) {
                            break;
                        }
                    } else {
                        this.f11086 = c4140.m6702() == 172;
                    }
                }
                if (z) {
                    this.f11084 = 1;
                    byte[] bArr = this.f11080.f13227;
                    bArr[0] = -84;
                    bArr[1] = (byte) (this.f11087 ? 65 : 64);
                    this.f11085 = 2;
                }
            } else if (i == 1) {
                byte[] bArr2 = this.f11080.f13227;
                int iMin = Math.min(c4140.m6679(), 16 - this.f11085);
                System.arraycopy(c4140.f13227, c4140.f13228, bArr2, this.f11085, iMin);
                c4140.f13228 += iMin;
                int i2 = this.f11085 + iMin;
                this.f11085 = i2;
                if (i2 == 16) {
                    this.f11079.m6672(0);
                    C3475.C3477 c3477M5756 = C3475.m5756(this.f11079);
                    C3431 c3431 = this.f11089;
                    if (c3431 == null || c3477M5756.f10282 != c3431.f10103 || c3477M5756.f10281 != c3431.f10104 || !"audio/ac4".equals(c3431.f10090)) {
                        C3431 c3431M5585 = C3431.m5585(this.f11082, "audio/ac4", null, -1, -1, c3477M5756.f10282, c3477M5756.f10281, null, null, 0, this.f11081);
                        this.f11089 = c3431M5585;
                        this.f11083.mo5884(c3431M5585);
                    }
                    this.f11090 = c3477M5756.f10283;
                    this.f11088 = (((long) c3477M5756.f10284) * 1000000) / ((long) this.f11089.f10104);
                    this.f11080.m6693(0);
                    this.f11083.mo5885(this.f11080, 16);
                    this.f11084 = 2;
                }
            } else if (i == 2) {
                int iMin2 = Math.min(c4140.m6679(), this.f11090 - this.f11085);
                this.f11083.mo5885(c4140, iMin2);
                int i3 = this.f11085 + iMin2;
                this.f11085 = i3;
                int i4 = this.f11090;
                if (i3 == i4) {
                    this.f11083.mo5883(this.f11091, 1, i4, 0, null);
                    this.f11091 += this.f11088;
                    this.f11084 = 0;
                }
            }
        }
    }

    @Override // p138.p176.p177.p190.p198.p207.InterfaceC3660
    /* JADX INFO: renamed from: ؠ */
    public void mo6001() {
    }
}
