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

import com.google.android.exoplayer2.ParserException;
import java.io.EOFException;
import p138.p176.p177.p190.p198.C3558;
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 C3641 {

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

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

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

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

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

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

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final int[] f11025 = new int[255];

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public final C4140 f11026 = new C4140(255);

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m5992() {
        this.f11019 = 0;
        this.f11020 = 0;
        this.f11021 = 0L;
        this.f11022 = 0;
        this.f11023 = 0;
        this.f11024 = 0;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public boolean m5993(C3558 c3558, boolean z) throws ParserException, EOFException {
        this.f11026.m6709();
        m5992();
        long j = c3558.f10562;
        if (!(j == -1 || j - c3558.m5872() >= 27) || !c3558.m5875(this.f11026.f13227, 0, 27, true)) {
            if (z) {
                return false;
            }
            throw new EOFException();
        }
        if (this.f11026.m6703() != 1332176723) {
            if (z) {
                return false;
            }
            throw new ParserException("expected OggS capture pattern at begin of page");
        }
        int iM6702 = this.f11026.m6702();
        this.f11019 = iM6702;
        if (iM6702 != 0) {
            if (z) {
                return false;
            }
            throw new ParserException("unsupported bit stream revision");
        }
        this.f11020 = this.f11026.m6702();
        C4140 c4140 = this.f11026;
        byte[] bArr = c4140.f13227;
        int i = c4140.f13228;
        int i2 = i + 1;
        c4140.f13228 = i2;
        long j2 = ((long) bArr[i]) & 255;
        int i3 = i2 + 1;
        c4140.f13228 = i3;
        long j3 = j2 | ((((long) bArr[i2]) & 255) << 8);
        int i4 = i3 + 1;
        c4140.f13228 = i4;
        long j4 = j3 | ((((long) bArr[i3]) & 255) << 16);
        int i5 = i4 + 1;
        c4140.f13228 = i5;
        long j5 = j4 | ((((long) bArr[i4]) & 255) << 24);
        int i6 = i5 + 1;
        c4140.f13228 = i6;
        long j6 = j5 | ((((long) bArr[i5]) & 255) << 32);
        int i7 = i6 + 1;
        c4140.f13228 = i7;
        long j7 = j6 | ((((long) bArr[i6]) & 255) << 40);
        int i8 = i7 + 1;
        c4140.f13228 = i8;
        long j8 = j7 | ((((long) bArr[i7]) & 255) << 48);
        c4140.f13228 = i8 + 1;
        this.f11021 = ((((long) bArr[i8]) & 255) << 56) | j8;
        c4140.m6696();
        this.f11026.m6696();
        this.f11026.m6696();
        int iM67022 = this.f11026.m6702();
        this.f11022 = iM67022;
        this.f11023 = iM67022 + 27;
        this.f11026.m6709();
        c3558.m5875(this.f11026.f13227, 0, this.f11022, false);
        for (int i9 = 0; i9 < this.f11022; i9++) {
            this.f11025[i9] = this.f11026.m6702();
            this.f11024 += this.f11025[i9];
        }
        return true;
    }
}
