package com.google.android.gms.internal.ads;

/* JADX INFO: loaded from: classes2.dex */
public final class n3 implements o2 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final int f14423a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int f14424b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final String f14425c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public int f14426d;

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public q2 f14428f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public u3 f14429g;

    public n3(int i10, int i11, String str) {
        this.f14423a = i10;
        this.f14424b = i11;
        this.f14425c = str;
    }

    @Override // com.google.android.gms.internal.ads.o2
    public final boolean a(p2 p2Var) {
        int i10 = this.f14424b;
        int i11 = this.f14423a;
        ih1.b1((i11 == -1 || i10 == -1) ? false : true);
        p01 p01Var = new p01(i10);
        ((h2) p2Var).j(p01Var.f15225a, 0, i10, false);
        return p01Var.J() == i11;
    }

    @Override // com.google.android.gms.internal.ads.o2
    public final void b(q2 q2Var) {
        this.f14428f = q2Var;
        u3 u3VarE = q2Var.e(1024, 4);
        this.f14429g = u3VarE;
        sm2 sm2Var = new sm2();
        String str = this.f14425c;
        sm2Var.zzl(str);
        sm2Var.zzm(str);
        u3VarE.d(new zn2(sm2Var));
        this.f14428f.d();
        this.f14428f.k(new o3());
        this.f14427e = 1;
    }

    @Override // com.google.android.gms.internal.ads.o2
    public final int c(p2 p2Var, androidx.media3.extractor.f0 f0Var) {
        int i10 = this.f14427e;
        if (i10 != 1) {
            if (i10 == 2) {
                return -1;
            }
            throw new IllegalStateException();
        }
        u3 u3Var = this.f14429g;
        u3Var.getClass();
        int iE = u3Var.e(p2Var, 1024, true);
        if (iE == -1) {
            this.f14427e = 2;
            this.f14429g.zze(0L, 1, this.f14426d, 0, null);
            this.f14426d = 0;
        } else {
            this.f14426d += iE;
        }
        return 0;
    }

    @Override // com.google.android.gms.internal.ads.o2
    public final void d(long j10, long j11) {
        if (j10 == 0 || this.f14427e == 1) {
            this.f14427e = 1;
            this.f14426d = 0;
        }
    }

    @Override // com.google.android.gms.internal.ads.o2
    public final void zzf() {
    }
}
