package o6; import d6.r0; import f8.w; import f8.y; import g8.a; import l6.b0; import o6.e; /* compiled from: VideoTagPayloadReader.java */ /* loaded from: classes4.dex */ final class f extends e { /* renamed from: b reason: collision with root package name */ private final y f19093b = new y(w.f11390a); /* renamed from: c reason: collision with root package name */ private final y f19094c = new y(4); /* renamed from: d reason: collision with root package name */ private int f19095d; /* renamed from: e reason: collision with root package name */ private boolean f19096e; /* renamed from: f reason: collision with root package name */ private boolean f19097f; /* renamed from: g reason: collision with root package name */ private int f19098g; public f(b0 b0Var) { super(b0Var); } @Override // o6.e protected boolean b(y yVar) { int D = yVar.D(); int i10 = (D >> 4) & 15; int i11 = D & 15; if (i11 == 7) { this.f19098g = i10; return i10 != 5; } throw new e.a("Video format not supported: " + i11); } @Override // o6.e protected boolean c(y yVar, long j10) { int D = yVar.D(); long o2 = j10 + (yVar.o() * 1000); if (D == 0 && !this.f19096e) { y yVar2 = new y(new byte[yVar.a()]); yVar.j(yVar2.d(), 0, yVar.a()); a b10 = a.b(yVar2); this.f19095d = b10.f12492b; this.f19092a.a(new r0.b().e0("video/avc").I(b10.f12496f).j0(b10.f12493c).Q(b10.f12494d).a0(b10.f12495e).T(b10.f12491a).E()); this.f19096e = true; return false; } else if (D != 1 || !this.f19096e) { return false; } else { int i10 = this.f19098g == 1 ? 1 : 0; if (!this.f19097f && i10 == 0) { return false; } byte[] d10 = this.f19094c.d(); d10[0] = 0; d10[1] = 0; d10[2] = 0; int i11 = 4 - this.f19095d; int i12 = 0; while (yVar.a() > 0) { yVar.j(this.f19094c.d(), i11, this.f19095d); this.f19094c.P(0); int H = this.f19094c.H(); this.f19093b.P(0); this.f19092a.e(this.f19093b, 4); this.f19092a.e(yVar, H); i12 = i12 + 4 + H; } this.f19092a.b(o2, i10, i12, 0, null); this.f19097f = true; return true; } } }