package A;

import android.util.Log;
import b0.t;
import n.x;

/* JADX INFO: loaded from: classes.dex */
final class j extends e {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final t f124b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private boolean f125c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private long f126d;

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private int f128f;

    public j(v.o oVar) {
        super(oVar);
        oVar.c(x.k());
        this.f124b = new t(10);
    }

    @Override // A.e
    public void a(t tVar) {
        if (this.f125c) {
            int iA = tVar.a();
            int i2 = this.f128f;
            if (i2 < 10) {
                int iMin = Math.min(iA, 10 - i2);
                System.arraycopy(tVar.f3092a, tVar.c(), this.f124b.f3092a, this.f128f, iMin);
                if (this.f128f + iMin == 10) {
                    this.f124b.B(0);
                    if (73 != this.f124b.q() || 68 != this.f124b.q() || 51 != this.f124b.q()) {
                        Log.w("Id3Reader", "Discarding invalid ID3 tag");
                        this.f125c = false;
                        return;
                    } else {
                        this.f124b.C(3);
                        this.f127e = this.f124b.p() + 10;
                    }
                }
            }
            int iMin2 = Math.min(iA, this.f127e - this.f128f);
            this.f38a.a(tVar, iMin2);
            this.f128f += iMin2;
        }
    }

    @Override // A.e
    public void b() {
        int i2;
        if (this.f125c && (i2 = this.f127e) != 0 && this.f128f == i2) {
            this.f38a.e(this.f126d, 1, i2, 0, null);
            this.f125c = false;
        }
    }

    @Override // A.e
    public void c(long j2, boolean z2) {
        if (z2) {
            this.f125c = true;
            this.f126d = j2;
            this.f127e = 0;
            this.f128f = 0;
        }
    }

    @Override // A.e
    public void d() {
        this.f125c = false;
    }
}
