package defpackage;

import androidx.media3.decoder.DecoderInputBuffer$InsufficientCapacityException;
import java.nio.ByteBuffer;

/* JADX INFO: renamed from: ᵞᵜ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public class C3008 extends AbstractC2554 {

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public long f11577;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public ByteBuffer f11578;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public final int f11579;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public C5286 f11580;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final C1243 f11581;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public ByteBuffer f11582;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public boolean f11583;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public final int f11584;

    static {
        AbstractC0456.m1895("media3.decoder");
    }

    public C3008(int i, int i2) {
        super(0);
        this.f11581 = new C1243();
        this.f11584 = i;
        this.f11579 = i2;
    }

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public final ByteBuffer m7090(int i) {
        int i2 = this.f11584;
        if (i2 == 1) {
            return ByteBuffer.allocate(i);
        }
        if (i2 == 2) {
            return ByteBuffer.allocateDirect(i);
        }
        ByteBuffer byteBuffer = this.f11582;
        throw new DecoderInputBuffer$InsufficientCapacityException("Buffer too small (" + (byteBuffer == null ? 0 : byteBuffer.capacity()) + " < " + i + ")");
    }

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public void mo7091() {
        this.f9866 = 0;
        ByteBuffer byteBuffer = this.f11582;
        if (byteBuffer != null) {
            byteBuffer.clear();
        }
        ByteBuffer byteBuffer2 = this.f11578;
        if (byteBuffer2 != null) {
            byteBuffer2.clear();
        }
        this.f11583 = false;
    }

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public final void m7092() {
        ByteBuffer byteBuffer = this.f11582;
        if (byteBuffer != null) {
            byteBuffer.flip();
        }
        ByteBuffer byteBuffer2 = this.f11578;
        if (byteBuffer2 != null) {
            byteBuffer2.flip();
        }
    }

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public final void m7093(int i) {
        int i2 = i + this.f11579;
        ByteBuffer byteBuffer = this.f11582;
        if (byteBuffer == null) {
            this.f11582 = m7090(i2);
            return;
        }
        int iCapacity = byteBuffer.capacity();
        int iPosition = byteBuffer.position();
        int i3 = i2 + iPosition;
        if (iCapacity >= i3) {
            this.f11582 = byteBuffer;
            return;
        }
        ByteBuffer byteBufferM7090 = m7090(i3);
        byteBufferM7090.order(byteBuffer.order());
        if (iPosition > 0) {
            byteBuffer.flip();
            byteBufferM7090.put(byteBuffer);
        }
        this.f11582 = byteBufferM7090;
    }
}
