.class public final Lz5/ky0;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Lz5/uq0;


# instance fields
.field public A:Ljava/nio/ByteBuffer;

.field public B:[B

.field public C:I

.field public D:I

.field public E:Z

.field public F:Z

.field public G:Z

.field public H:Z

.field public I:I

.field public J:Lz5/op1;

.field public K:J

.field public L:Z

.field public final M:Lcom/google/android/gms/internal/ads/d1;

.field public final a:Lz5/st0;

.field public final b:Lz5/z11;

.field public final c:[Lz5/ai0;

.field public final d:[Lz5/ai0;

.field public final e:Landroid/os/ConditionVariable;

.field public final f:Lz5/ls0;

.field public final g:Ljava/util/ArrayDeque;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayDeque<",
            "Lz5/qv0;",
            ">;"
        }
    .end annotation
.end field

.field public h:Lz5/yx0;

.field public final i:Lz5/yu1;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lz5/yu1;"
        }
    .end annotation
.end field

.field public final j:Lz5/yu1;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lz5/yu1;"
        }
    .end annotation
.end field

.field public k:Lz5/fz0;

.field public l:Lz5/su0;

.field public m:Lz5/su0;

.field public n:Landroid/media/AudioTrack;

.field public o:Lz5/ch1;

.field public p:Lz5/qv0;

.field public q:Lz5/qv0;

.field public r:J

.field public s:J

.field public t:Z

.field public u:Z

.field public v:J

.field public w:F

.field public x:[Lz5/ai0;

.field public y:[Ljava/nio/ByteBuffer;

.field public z:Ljava/nio/ByteBuffer;


# direct methods
.method public constructor <init>([Lz5/ai0;Z)V
    .registers 16

    new-instance p2, Lcom/google/android/gms/internal/ads/d1;

    invoke-direct {p2, p1}, Lcom/google/android/gms/internal/ads/d1;-><init>([Lz5/ai0;)V

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p2, p0, Lz5/ky0;->M:Lcom/google/android/gms/internal/ads/d1;

    sget p1, Lz5/r7;->a:I

    new-instance p1, Landroid/os/ConditionVariable;

    const/4 v0, 0x1

    invoke-direct {p1, v0}, Landroid/os/ConditionVariable;-><init>(Z)V

    iput-object p1, p0, Lz5/ky0;->e:Landroid/os/ConditionVariable;

    new-instance p1, Lz5/ls0;

    new-instance v1, Lz5/zw0;

    invoke-direct {v1, p0}, Lz5/zw0;-><init>(Lz5/ky0;)V

    invoke-direct {p1, v1}, Lz5/ls0;-><init>(Lz5/zw0;)V

    iput-object p1, p0, Lz5/ky0;->f:Lz5/ls0;

    new-instance p1, Lz5/st0;

    invoke-direct {p1}, Lz5/st0;-><init>()V

    iput-object p1, p0, Lz5/ky0;->a:Lz5/st0;

    new-instance v1, Lz5/z11;

    invoke-direct {v1}, Lz5/z11;-><init>()V

    iput-object v1, p0, Lz5/ky0;->b:Lz5/z11;

    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    const/4 v3, 0x3

    new-array v3, v3, [Lz5/ct0;

    new-instance v4, Lz5/h01;

    invoke-direct {v4}, Lz5/h01;-><init>()V

    const/4 v5, 0x0

    aput-object v4, v3, v5

    aput-object p1, v3, v0

    const/4 p1, 0x2

    aput-object v1, v3, p1

    invoke-static {v2, v3}, Ljava/util/Collections;->addAll(Ljava/util/Collection;[Ljava/lang/Object;)Z

    .line 1
    iget-object p1, p2, Lcom/google/android/gms/internal/ads/d1;->s:Ljava/lang/Object;

    check-cast p1, [Lz5/ai0;

    .line 2
    invoke-static {v2, p1}, Ljava/util/Collections;->addAll(Ljava/util/Collection;[Ljava/lang/Object;)Z

    new-array p1, v5, [Lz5/ai0;

    invoke-virtual {v2, p1}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object p1

    check-cast p1, [Lz5/ai0;

    iput-object p1, p0, Lz5/ky0;->c:[Lz5/ai0;

    new-array p1, v0, [Lz5/ai0;

    new-instance p2, Lz5/wy0;

    invoke-direct {p2}, Lz5/wy0;-><init>()V

    aput-object p2, p1, v5

    iput-object p1, p0, Lz5/ky0;->d:[Lz5/ai0;

    const/high16 p1, 0x3f800000    # 1.0f

    iput p1, p0, Lz5/ky0;->w:F

    sget-object p1, Lz5/ch1;->b:Lz5/ch1;

    iput-object p1, p0, Lz5/ky0;->o:Lz5/ch1;

    iput v5, p0, Lz5/ky0;->I:I

    new-instance p1, Lz5/op1;

    invoke-direct {p1}, Lz5/op1;-><init>()V

    iput-object p1, p0, Lz5/ky0;->J:Lz5/op1;

    new-instance p1, Lz5/qv0;

    sget-object v7, Lz5/u3;->d:Lz5/u3;

    const/4 v8, 0x0

    const-wide/16 v9, 0x0

    const-wide/16 v11, 0x0

    move-object v6, p1

    invoke-direct/range {v6 .. v12}, Lz5/qv0;-><init>(Lz5/u3;ZJJ)V

    iput-object p1, p0, Lz5/ky0;->q:Lz5/qv0;

    const/4 p1, -0x1

    iput p1, p0, Lz5/ky0;->D:I

    new-array p1, v5, [Lz5/ai0;

    iput-object p1, p0, Lz5/ky0;->x:[Lz5/ai0;

    new-array p1, v5, [Ljava/nio/ByteBuffer;

    iput-object p1, p0, Lz5/ky0;->y:[Ljava/nio/ByteBuffer;

    new-instance p1, Ljava/util/ArrayDeque;

    invoke-direct {p1}, Ljava/util/ArrayDeque;-><init>()V

    iput-object p1, p0, Lz5/ky0;->g:Ljava/util/ArrayDeque;

    new-instance p1, Lz5/yu1;

    invoke-direct {p1}, Lz5/yu1;-><init>()V

    iput-object p1, p0, Lz5/ky0;->i:Lz5/yu1;

    new-instance p1, Lz5/yu1;

    invoke-direct {p1}, Lz5/yu1;-><init>()V

    iput-object p1, p0, Lz5/ky0;->j:Lz5/yu1;

    return-void
.end method

.method public static synthetic a(III)Landroid/media/AudioFormat;
    .registers 4

    new-instance v0, Landroid/media/AudioFormat$Builder;

    invoke-direct {v0}, Landroid/media/AudioFormat$Builder;-><init>()V

    invoke-virtual {v0, p0}, Landroid/media/AudioFormat$Builder;->setSampleRate(I)Landroid/media/AudioFormat$Builder;

    move-result-object p0

    invoke-virtual {p0, p1}, Landroid/media/AudioFormat$Builder;->setChannelMask(I)Landroid/media/AudioFormat$Builder;

    move-result-object p0

    invoke-virtual {p0, p2}, Landroid/media/AudioFormat$Builder;->setEncoding(I)Landroid/media/AudioFormat$Builder;

    move-result-object p0

    invoke-virtual {p0}, Landroid/media/AudioFormat$Builder;->build()Landroid/media/AudioFormat;

    move-result-object p0

    return-object p0
.end method

.method public static m(Landroid/media/AudioTrack;)Z
    .registers 3

    sget v0, Lz5/r7;->a:I

    const/16 v1, 0x1d

    if-lt v0, v1, :cond_e

    invoke-virtual {p0}, Landroid/media/AudioTrack;->isOffloadedPlayback()Z

    move-result p0

    if-eqz p0, :cond_e

    const/4 p0, 0x1

    return p0

    :cond_e
    const/4 p0, 0x0

    return p0
.end method


# virtual methods
.method public final b()V
    .registers 4

    const/4 v0, 0x0

    :goto_1
    iget-object v1, p0, Lz5/ky0;->x:[Lz5/ai0;

    array-length v2, v1

    if-ge v0, v2, :cond_16

    aget-object v1, v1, v0

    invoke-interface {v1}, Lz5/ai0;->zzg()V

    iget-object v2, p0, Lz5/ky0;->y:[Ljava/nio/ByteBuffer;

    invoke-interface {v1}, Lz5/ai0;->zze()Ljava/nio/ByteBuffer;

    move-result-object v1

    aput-object v1, v2, v0

    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    :cond_16
    return-void
.end method

.method public final c(J)V
    .registers 6

    iget-object p1, p0, Lz5/ky0;->x:[Lz5/ai0;

    array-length p1, p1

    move p2, p1

    :goto_4
    if-ltz p2, :cond_41

    if-lez p2, :cond_f

    iget-object v0, p0, Lz5/ky0;->y:[Ljava/nio/ByteBuffer;

    add-int/lit8 v1, p2, -0x1

    aget-object v0, v0, v1

    goto :goto_15

    :cond_f
    iget-object v0, p0, Lz5/ky0;->z:Ljava/nio/ByteBuffer;

    if-nez v0, :cond_15

    sget-object v0, Lz5/ai0;->a:Ljava/nio/ByteBuffer;

    :cond_15
    :goto_15
    if-ne p2, p1, :cond_1b

    invoke-virtual {p0, v0}, Lz5/ky0;->d(Ljava/nio/ByteBuffer;)V

    goto :goto_37

    :cond_1b
    iget-object v1, p0, Lz5/ky0;->x:[Lz5/ai0;

    aget-object v1, v1, p2

    iget v2, p0, Lz5/ky0;->D:I

    if-le p2, v2, :cond_26

    invoke-interface {v1, v0}, Lz5/ai0;->b(Ljava/nio/ByteBuffer;)V

    :cond_26
    invoke-interface {v1}, Lz5/ai0;->zze()Ljava/nio/ByteBuffer;

    move-result-object v1

    iget-object v2, p0, Lz5/ky0;->y:[Ljava/nio/ByteBuffer;

    aput-object v1, v2, p2

    invoke-virtual {v1}, Ljava/nio/ByteBuffer;->hasRemaining()Z

    move-result v1

    if-eqz v1, :cond_37

    add-int/lit8 p2, p2, 0x1

    goto :goto_4

    :cond_37
    :goto_37
    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->hasRemaining()Z

    move-result v0

    if-eqz v0, :cond_3e

    return-void

    :cond_3e
    add-int/lit8 p2, p2, -0x1

    goto :goto_4

    :cond_41
    return-void
.end method

.method public final d(Ljava/nio/ByteBuffer;)V
    .registers 13

    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->hasRemaining()Z

    move-result v0

    if-nez v0, :cond_7

    return-void

    :cond_7
    iget-object v0, p0, Lz5/ky0;->A:Ljava/nio/ByteBuffer;

    const/16 v1, 0x15

    const/4 v2, 0x1

    const/4 v3, 0x0

    if-eqz v0, :cond_18

    if-ne v0, p1, :cond_13

    move v0, v2

    goto :goto_14

    :cond_13
    move v0, v3

    :goto_14
    invoke-static {v0}, Lcom/google/android/gms/internal/ads/d;->e(Z)V

    goto :goto_3b

    :cond_18
    iput-object p1, p0, Lz5/ky0;->A:Ljava/nio/ByteBuffer;

    sget v0, Lz5/r7;->a:I

    if-ge v0, v1, :cond_3b

    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v0

    iget-object v4, p0, Lz5/ky0;->B:[B

    if-eqz v4, :cond_29

    array-length v4, v4

    if-ge v4, v0, :cond_2d

    :cond_29
    new-array v4, v0, [B

    iput-object v4, p0, Lz5/ky0;->B:[B

    :cond_2d
    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->position()I

    move-result v4

    iget-object v5, p0, Lz5/ky0;->B:[B

    invoke-virtual {p1, v5, v3, v0}, Ljava/nio/ByteBuffer;->get([BII)Ljava/nio/ByteBuffer;

    invoke-virtual {p1, v4}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;

    iput v3, p0, Lz5/ky0;->C:I

    :cond_3b
    :goto_3b
    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v0

    sget v4, Lz5/r7;->a:I

    if-ge v4, v1, :cond_76

    iget-object v1, p0, Lz5/ky0;->f:Lz5/ls0;

    iget-wide v5, p0, Lz5/ky0;->s:J

    .line 1
    invoke-virtual {v1}, Lz5/ls0;->c()J

    move-result-wide v7

    iget v9, v1, Lz5/ls0;->d:I

    iget v1, v1, Lz5/ls0;->e:I

    int-to-long v9, v9

    mul-long/2addr v7, v9

    sub-long/2addr v5, v7

    long-to-int v5, v5

    sub-int/2addr v1, v5

    if-lez v1, :cond_74

    .line 2
    invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I

    move-result v1

    iget-object v5, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    iget-object v6, p0, Lz5/ky0;->B:[B

    iget v7, p0, Lz5/ky0;->C:I

    invoke-virtual {v5, v6, v7, v1}, Landroid/media/AudioTrack;->write([BII)I

    move-result v1

    if-lez v1, :cond_7c

    iget v5, p0, Lz5/ky0;->C:I

    add-int/2addr v5, v1

    iput v5, p0, Lz5/ky0;->C:I

    invoke-virtual {p1}, Ljava/nio/ByteBuffer;->position()I

    move-result v5

    add-int/2addr v5, v1

    invoke-virtual {p1, v5}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;

    goto :goto_7c

    :cond_74
    move v1, v3

    goto :goto_7c

    :cond_76
    iget-object v1, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    invoke-virtual {v1, p1, v0, v2}, Landroid/media/AudioTrack;->write(Ljava/nio/ByteBuffer;II)I

    move-result v1

    :cond_7c
    :goto_7c
    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v5

    iput-wide v5, p0, Lz5/ky0;->K:J

    if-gez v1, :cond_ac

    const/16 p1, 0x18

    if-lt v4, p1, :cond_8b

    const/4 p1, -0x6

    if-eq v1, p1, :cond_91

    :cond_8b
    const/16 p1, -0x20

    if-ne v1, p1, :cond_90

    goto :goto_91

    :cond_90
    move v2, v3

    :cond_91
    :goto_91
    new-instance p1, Lz5/iq0;

    iget-object v0, p0, Lz5/ky0;->m:Lz5/su0;

    iget-object v0, v0, Lz5/su0;->a:Lz5/x2;

    invoke-direct {p1, v1, v0, v2}, Lz5/iq0;-><init>(ILz5/x2;Z)V

    iget-object v0, p0, Lz5/ky0;->k:Lz5/fz0;

    if-eqz v0, :cond_a1

    invoke-virtual {v0, p1}, Lz5/fz0;->a(Ljava/lang/Exception;)V

    :cond_a1
    iget-boolean v0, p1, Lz5/iq0;->r:Z

    if-nez v0, :cond_ab

    iget-object v0, p0, Lz5/ky0;->j:Lz5/yu1;

    invoke-virtual {v0, p1}, Lz5/yu1;->m(Ljava/lang/Exception;)V

    return-void

    :cond_ab
    throw p1

    :cond_ac
    iget-object p1, p0, Lz5/ky0;->j:Lz5/yu1;

    const/4 v2, 0x0

    .line 3
    iput-object v2, p1, Lz5/yu1;->r:Ljava/lang/Object;

    .line 4
    iget-object p1, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    invoke-static {p1}, Lz5/ky0;->m(Landroid/media/AudioTrack;)Z

    move-result p1

    if-eqz p1, :cond_e1

    iget-boolean p1, p0, Lz5/ky0;->G:Z

    if-eqz p1, :cond_e1

    iget-object p1, p0, Lz5/ky0;->k:Lz5/fz0;

    if-eqz p1, :cond_e1

    if-ge v1, v0, :cond_e1

    iget-boolean p1, p0, Lz5/ky0;->L:Z

    if-nez p1, :cond_e1

    iget-object p1, p0, Lz5/ky0;->f:Lz5/ls0;

    .line 5
    invoke-virtual {p1}, Lz5/ls0;->c()J

    move-result-wide v3

    neg-long v3, v3

    invoke-virtual {p1, v3, v4}, Lz5/ls0;->b(J)J

    move-result-wide v3

    invoke-static {v3, v4}, Lz5/v1;->a(J)J

    move-result-wide v3

    .line 6
    iget-object p1, p0, Lz5/ky0;->k:Lz5/fz0;

    iget-object p1, p1, Lz5/fz0;->a:Lz5/wz0;

    .line 7
    iget-object p1, p1, Lz5/wz0;->Z0:Lz5/d4;

    if-eqz p1, :cond_e1

    .line 8
    invoke-interface {p1, v3, v4}, Lz5/d4;->a(J)V

    :cond_e1
    iget-object p1, p0, Lz5/ky0;->m:Lz5/su0;

    invoke-static {p1}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    iget-wide v3, p0, Lz5/ky0;->s:J

    int-to-long v5, v1

    add-long/2addr v3, v5

    iput-wide v3, p0, Lz5/ky0;->s:J

    if-ne v1, v0, :cond_f0

    iput-object v2, p0, Lz5/ky0;->A:Ljava/nio/ByteBuffer;

    :cond_f0
    return-void
.end method

.method public final e()Z
    .registers 8

    iget v0, p0, Lz5/ky0;->D:I

    const/4 v1, -0x1

    const/4 v2, 0x1

    const/4 v3, 0x0

    if-ne v0, v1, :cond_b

    iput v3, p0, Lz5/ky0;->D:I

    :goto_9
    move v0, v2

    goto :goto_c

    :cond_b
    move v0, v3

    :goto_c
    iget v4, p0, Lz5/ky0;->D:I

    iget-object v5, p0, Lz5/ky0;->x:[Lz5/ai0;

    array-length v6, v5

    if-ge v4, v6, :cond_2f

    aget-object v4, v5, v4

    if-eqz v0, :cond_1a

    invoke-interface {v4}, Lz5/ai0;->zzd()V

    :cond_1a
    const-wide v5, -0x7fffffffffffffffL    # -4.9E-324

    invoke-virtual {p0, v5, v6}, Lz5/ky0;->c(J)V

    invoke-interface {v4}, Lz5/ai0;->zzf()Z

    move-result v0

    if-nez v0, :cond_29

    return v3

    :cond_29
    iget v0, p0, Lz5/ky0;->D:I

    add-int/2addr v0, v2

    iput v0, p0, Lz5/ky0;->D:I

    goto :goto_9

    :cond_2f
    iget-object v0, p0, Lz5/ky0;->A:Ljava/nio/ByteBuffer;

    if-eqz v0, :cond_3b

    invoke-virtual {p0, v0}, Lz5/ky0;->d(Ljava/nio/ByteBuffer;)V

    iget-object v0, p0, Lz5/ky0;->A:Ljava/nio/ByteBuffer;

    if-eqz v0, :cond_3b

    return v3

    :cond_3b
    iput v1, p0, Lz5/ky0;->D:I

    return v2
.end method

.method public final f()V
    .registers 3

    invoke-virtual {p0}, Lz5/ky0;->k()Z

    move-result v0

    if-nez v0, :cond_7

    return-void

    :cond_7
    sget v0, Lz5/r7;->a:I

    const/16 v1, 0x15

    if-lt v0, v1, :cond_15

    iget-object v0, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    iget v1, p0, Lz5/ky0;->w:F

    invoke-virtual {v0, v1}, Landroid/media/AudioTrack;->setVolume(F)I

    return-void

    :cond_15
    iget-object v0, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    iget v1, p0, Lz5/ky0;->w:F

    invoke-virtual {v0, v1, v1}, Landroid/media/AudioTrack;->setStereoVolume(FF)I

    return-void
.end method

.method public final g(Lz5/u3;Z)V
    .registers 11

    invoke-virtual {p0}, Lz5/ky0;->h()Lz5/qv0;

    move-result-object v0

    iget-object v1, v0, Lz5/qv0;->a:Lz5/u3;

    invoke-virtual {p1, v1}, Lz5/u3;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_12

    iget-boolean v0, v0, Lz5/qv0;->b:Z

    if-eq p2, v0, :cond_11

    goto :goto_12

    :cond_11
    return-void

    :cond_12
    :goto_12
    new-instance v0, Lz5/qv0;

    const-wide v4, -0x7fffffffffffffffL    # -4.9E-324

    const-wide v6, -0x7fffffffffffffffL    # -4.9E-324

    move-object v1, v0

    move-object v2, p1

    move v3, p2

    invoke-direct/range {v1 .. v7}, Lz5/qv0;-><init>(Lz5/u3;ZJJ)V

    invoke-virtual {p0}, Lz5/ky0;->k()Z

    move-result p1

    if-eqz p1, :cond_2d

    iput-object v0, p0, Lz5/ky0;->p:Lz5/qv0;

    return-void

    :cond_2d
    iput-object v0, p0, Lz5/ky0;->q:Lz5/qv0;

    return-void
.end method

.method public final h()Lz5/qv0;
    .registers 2

    iget-object v0, p0, Lz5/ky0;->p:Lz5/qv0;

    if-eqz v0, :cond_5

    goto :goto_18

    :cond_5
    iget-object v0, p0, Lz5/ky0;->g:Ljava/util/ArrayDeque;

    invoke-virtual {v0}, Ljava/util/ArrayDeque;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_16

    iget-object v0, p0, Lz5/ky0;->g:Ljava/util/ArrayDeque;

    invoke-virtual {v0}, Ljava/util/ArrayDeque;->getLast()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lz5/qv0;

    goto :goto_18

    :cond_16
    iget-object v0, p0, Lz5/ky0;->q:Lz5/qv0;

    :goto_18
    return-object v0
.end method

.method public final i(J)V
    .registers 14

    invoke-virtual {p0}, Lz5/ky0;->j()Z

    move-result v0

    if-eqz v0, :cond_2c

    iget-object v0, p0, Lz5/ky0;->M:Lcom/google/android/gms/internal/ads/d1;

    invoke-virtual {p0}, Lz5/ky0;->h()Lz5/qv0;

    move-result-object v1

    iget-object v1, v1, Lz5/qv0;->a:Lz5/u3;

    .line 1
    iget-object v0, v0, Lcom/google/android/gms/internal/ads/d1;->u:Ljava/lang/Object;

    check-cast v0, Lz5/m11;

    iget v2, v1, Lz5/u3;->a:F

    .line 2
    iget v3, v0, Lz5/m11;->c:F

    cmpl-float v3, v3, v2

    const/4 v4, 0x1

    if-eqz v3, :cond_1f

    iput v2, v0, Lz5/m11;->c:F

    iput-boolean v4, v0, Lz5/m11;->i:Z

    .line 3
    :cond_1f
    iget v2, v1, Lz5/u3;->b:F

    .line 4
    iget v3, v0, Lz5/m11;->d:F

    cmpl-float v3, v3, v2

    if-eqz v3, :cond_2e

    iput v2, v0, Lz5/m11;->d:F

    iput-boolean v4, v0, Lz5/m11;->i:Z

    goto :goto_2e

    .line 5
    :cond_2c
    sget-object v1, Lz5/u3;->d:Lz5/u3;

    :cond_2e
    :goto_2e
    move-object v3, v1

    invoke-virtual {p0}, Lz5/ky0;->j()Z

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_46

    iget-object v0, p0, Lz5/ky0;->M:Lcom/google/android/gms/internal/ads/d1;

    invoke-virtual {p0}, Lz5/ky0;->h()Lz5/qv0;

    move-result-object v2

    iget-boolean v2, v2, Lz5/qv0;->b:Z

    .line 6
    iget-object v0, v0, Lcom/google/android/gms/internal/ads/d1;->t:Ljava/lang/Object;

    check-cast v0, Lz5/t01;

    .line 7
    iput-boolean v2, v0, Lz5/t01;->j:Z

    move v0, v2

    goto :goto_47

    :cond_46
    move v0, v1

    .line 8
    :goto_47
    iget-object v9, p0, Lz5/ky0;->g:Ljava/util/ArrayDeque;

    new-instance v10, Lz5/qv0;

    const-wide/16 v4, 0x0

    invoke-static {v4, v5, p1, p2}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v5

    iget-object p1, p0, Lz5/ky0;->m:Lz5/su0;

    invoke-virtual {p0}, Lz5/ky0;->l()J

    move-result-wide v7

    invoke-virtual {p1, v7, v8}, Lz5/su0;->a(J)J

    move-result-wide v7

    move-object v2, v10

    move v4, v0

    invoke-direct/range {v2 .. v8}, Lz5/qv0;-><init>(Lz5/u3;ZJJ)V

    invoke-virtual {v9, v10}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z

    iget-object p1, p0, Lz5/ky0;->m:Lz5/su0;

    iget-object p1, p1, Lz5/su0;->h:[Lz5/ai0;

    new-instance p2, Ljava/util/ArrayList;

    invoke-direct {p2}, Ljava/util/ArrayList;-><init>()V

    array-length v2, p1

    :goto_6d
    if-ge v1, v2, :cond_81

    aget-object v3, p1, v1

    invoke-interface {v3}, Lz5/ai0;->zzb()Z

    move-result v4

    if-eqz v4, :cond_7b

    invoke-virtual {p2, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_7e

    :cond_7b
    invoke-interface {v3}, Lz5/ai0;->zzg()V

    :goto_7e
    add-int/lit8 v1, v1, 0x1

    goto :goto_6d

    :cond_81
    invoke-virtual {p2}, Ljava/util/ArrayList;->size()I

    move-result p1

    new-array v1, p1, [Lz5/ai0;

    invoke-virtual {p2, v1}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object p2

    check-cast p2, [Lz5/ai0;

    iput-object p2, p0, Lz5/ky0;->x:[Lz5/ai0;

    new-array p1, p1, [Ljava/nio/ByteBuffer;

    iput-object p1, p0, Lz5/ky0;->y:[Ljava/nio/ByteBuffer;

    invoke-virtual {p0}, Lz5/ky0;->b()V

    iget-object p1, p0, Lz5/ky0;->k:Lz5/fz0;

    if-eqz p1, :cond_ac

    iget-object p1, p1, Lz5/fz0;->a:Lz5/wz0;

    .line 9
    iget-object p1, p1, Lz5/wz0;->Q0:Landroidx/appcompat/widget/n;

    .line 10
    iget-object p2, p1, Landroidx/appcompat/widget/n;->s:Ljava/lang/Object;

    check-cast p2, Landroid/os/Handler;

    if-eqz p2, :cond_ac

    new-instance v1, Lz5/bm0;

    invoke-direct {v1, p1, v0}, Lz5/bm0;-><init>(Landroidx/appcompat/widget/n;Z)V

    invoke-virtual {p2, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    :cond_ac
    return-void
.end method

.method public final j()Z
    .registers 3

    iget-object v0, p0, Lz5/ky0;->m:Lz5/su0;

    iget-object v0, v0, Lz5/su0;->a:Lz5/x2;

    iget-object v0, v0, Lz5/x2;->k:Ljava/lang/String;

    const-string v1, "audio/raw"

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_16

    iget-object v0, p0, Lz5/ky0;->m:Lz5/su0;

    iget-object v0, v0, Lz5/su0;->a:Lz5/x2;

    iget v0, v0, Lz5/x2;->z:I

    const/4 v0, 0x1

    return v0

    :cond_16
    const/4 v0, 0x0

    return v0
.end method

.method public final k()Z
    .registers 2

    iget-object v0, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    if-eqz v0, :cond_6

    const/4 v0, 0x1

    return v0

    :cond_6
    const/4 v0, 0x0

    return v0
.end method

.method public final l()J
    .registers 6

    iget-object v0, p0, Lz5/ky0;->m:Lz5/su0;

    invoke-static {v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    iget-wide v1, p0, Lz5/ky0;->s:J

    iget v0, v0, Lz5/su0;->c:I

    int-to-long v3, v0

    div-long/2addr v1, v3

    return-wide v1
.end method

.method public final n()V
    .registers 8

    iget-boolean v0, p0, Lz5/ky0;->F:Z

    if-nez v0, :cond_23

    const/4 v0, 0x1

    iput-boolean v0, p0, Lz5/ky0;->F:Z

    iget-object v0, p0, Lz5/ky0;->f:Lz5/ls0;

    invoke-virtual {p0}, Lz5/ky0;->l()J

    move-result-wide v1

    .line 1
    invoke-virtual {v0}, Lz5/ls0;->c()J

    move-result-wide v3

    iput-wide v3, v0, Lz5/ls0;->x:J

    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v3

    const-wide/16 v5, 0x3e8

    mul-long/2addr v3, v5

    iput-wide v3, v0, Lz5/ls0;->v:J

    iput-wide v1, v0, Lz5/ls0;->y:J

    .line 2
    iget-object v0, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    invoke-virtual {v0}, Landroid/media/AudioTrack;->stop()V

    :cond_23
    return-void
.end method

.method public final o(Lz5/x2;)I
    .registers 5

    iget-object v0, p1, Lz5/x2;->k:Ljava/lang/String;

    const-string v1, "audio/raw"

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_34

    iget v0, p1, Lz5/x2;->z:I

    invoke-static {v0}, Lz5/r7;->h(I)Z

    move-result v0

    iget p1, p1, Lz5/x2;->z:I

    if-nez v0, :cond_2e

    new-instance v0, Ljava/lang/StringBuilder;

    const/16 v2, 0x21

    invoke-direct {v0, v2}, Ljava/lang/StringBuilder;-><init>(I)V

    const-string v2, "Invalid PCM encoding: "

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    const-string v0, "DefaultAudioSink"

    invoke-static {v0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    return v1

    :cond_2e
    const/4 v0, 0x2

    if-eq p1, v0, :cond_33

    const/4 p1, 0x1

    return p1

    :cond_33
    return v0

    :cond_34
    sget p1, Lz5/r7;->a:I

    return v1
.end method

.method public final p(Lz5/x2;I[I)V
    .registers 13

    iget-object p2, p1, Lz5/x2;->k:Ljava/lang/String;

    const-string v0, "audio/raw"

    invoke-virtual {v0, p2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p2

    if-eqz p2, :cond_ea

    iget p2, p1, Lz5/x2;->z:I

    invoke-static {p2}, Lz5/r7;->h(I)Z

    move-result p2

    invoke-static {p2}, Lcom/google/android/gms/internal/ads/d;->e(Z)V

    iget p2, p1, Lz5/x2;->z:I

    iget v0, p1, Lz5/x2;->x:I

    invoke-static {p2, v0}, Lz5/r7;->i(II)I

    move-result v3

    iget-object v8, p0, Lz5/ky0;->c:[Lz5/ai0;

    iget-object p2, p0, Lz5/ky0;->b:Lz5/z11;

    iget v0, p1, Lz5/x2;->A:I

    iget v1, p1, Lz5/x2;->B:I

    .line 1
    iput v0, p2, Lz5/z11;->i:I

    iput v1, p2, Lz5/z11;->j:I

    .line 2
    sget p2, Lz5/r7;->a:I

    const/16 v0, 0x15

    const/4 v1, 0x0

    if-ge p2, v0, :cond_41

    iget p2, p1, Lz5/x2;->x:I

    const/16 v2, 0x8

    if-ne p2, v2, :cond_41

    if-nez p3, :cond_41

    const/4 p2, 0x6

    new-array p3, p2, [I

    move v2, v1

    :goto_3a
    if-ge v2, p2, :cond_41

    aput v2, p3, v2

    add-int/lit8 v2, v2, 0x1

    goto :goto_3a

    :cond_41
    iget-object p2, p0, Lz5/ky0;->a:Lz5/st0;

    .line 3
    iput-object p3, p2, Lz5/st0;->i:[I

    .line 4
    new-instance p2, Lz5/rg0;

    iget p3, p1, Lz5/x2;->y:I

    iget v2, p1, Lz5/x2;->x:I

    iget v4, p1, Lz5/x2;->z:I

    invoke-direct {p2, p3, v2, v4}, Lz5/rg0;-><init>(III)V

    array-length p3, v8

    move v2, v1

    :goto_52
    if-ge v2, p3, :cond_6c

    aget-object v4, v8, v2

    :try_start_56
    invoke-interface {v4, p2}, Lz5/ai0;->a(Lz5/rg0;)Lz5/rg0;

    move-result-object v5

    invoke-interface {v4}, Lz5/ai0;->zzb()Z

    move-result v4
    :try_end_5e
    .catch Lz5/lh0; {:try_start_56 .. :try_end_5e} :catch_65

    const/4 v6, 0x1

    if-ne v6, v4, :cond_62

    move-object p2, v5

    :cond_62
    add-int/lit8 v2, v2, 0x1

    goto :goto_52

    :catch_65
    move-exception p2

    new-instance p3, Lz5/no0;

    invoke-direct {p3, p2, p1}, Lz5/no0;-><init>(Ljava/lang/Throwable;Lz5/x2;)V

    throw p3

    :cond_6c
    iget v7, p2, Lz5/rg0;->c:I

    iget v5, p2, Lz5/rg0;->a:I

    iget p2, p2, Lz5/rg0;->b:I

    packed-switch p2, :pswitch_data_fc

    goto :goto_98

    .line 5
    :pswitch_76
    sget p3, Lz5/r7;->a:I

    const/16 v2, 0x17

    const/16 v4, 0x18fc

    if-lt p3, v2, :cond_7f

    goto :goto_81

    :cond_7f
    if-lt p3, v0, :cond_98

    :goto_81
    move v6, v4

    goto :goto_99

    :pswitch_83
    const/16 p3, 0x4fc

    goto :goto_96

    :pswitch_86
    const/16 p3, 0xfc

    goto :goto_96

    :pswitch_89
    const/16 p3, 0xdc

    goto :goto_96

    :pswitch_8c
    const/16 p3, 0xcc

    goto :goto_96

    :pswitch_8f
    const/16 p3, 0x1c

    goto :goto_96

    :pswitch_92
    const/16 p3, 0xc

    goto :goto_96

    :pswitch_95
    const/4 p3, 0x4

    :goto_96
    move v6, p3

    goto :goto_99

    :cond_98
    :goto_98
    move v6, v1

    .line 6
    :goto_99
    invoke-static {v7, p2}, Lz5/r7;->i(II)I

    move-result v4

    if-eqz v7, :cond_cf

    if-eqz v6, :cond_b4

    new-instance p2, Lz5/su0;

    move-object v1, p2

    move-object v2, p1

    invoke-direct/range {v1 .. v8}, Lz5/su0;-><init>(Lz5/x2;IIIII[Lz5/ai0;)V

    invoke-virtual {p0}, Lz5/ky0;->k()Z

    move-result p1

    if-eqz p1, :cond_b1

    iput-object p2, p0, Lz5/ky0;->l:Lz5/su0;

    return-void

    :cond_b1
    iput-object p2, p0, Lz5/ky0;->m:Lz5/su0;

    return-void

    :cond_b4
    new-instance p2, Lz5/no0;

    invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p3

    invoke-virtual {p3}, Ljava/lang/String;->length()I

    move-result v0

    new-instance v1, Ljava/lang/StringBuilder;

    add-int/lit8 v0, v0, 0x36

    invoke-direct {v1, v0}, Ljava/lang/StringBuilder;-><init>(I)V

    const-string v0, "Invalid output channel config (mode=0) for: "

    invoke-static {v1, v0, p3}, Landroidx/activity/b;->a(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object p3

    invoke-direct {p2, p3, p1}, Lz5/no0;-><init>(Ljava/lang/String;Lz5/x2;)V

    throw p2

    :cond_cf
    new-instance p2, Lz5/no0;

    invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p3

    invoke-virtual {p3}, Ljava/lang/String;->length()I

    move-result v0

    new-instance v1, Ljava/lang/StringBuilder;

    add-int/lit8 v0, v0, 0x30

    invoke-direct {v1, v0}, Ljava/lang/StringBuilder;-><init>(I)V

    const-string v0, "Invalid output encoding (mode=0) for: "

    invoke-static {v1, v0, p3}, Landroidx/activity/b;->a(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object p3

    invoke-direct {p2, p3, p1}, Lz5/no0;-><init>(Ljava/lang/String;Lz5/x2;)V

    throw p2

    :cond_ea
    sget p2, Lz5/r7;->a:I

    new-instance p2, Lz5/no0;

    invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p3

    const-string v0, "Unable to configure passthrough for: "

    invoke-virtual {v0, p3}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p3

    invoke-direct {p2, p3, p1}, Lz5/no0;-><init>(Ljava/lang/String;Lz5/x2;)V

    throw p2

    :pswitch_data_fc
    .packed-switch 0x1
        :pswitch_95
        :pswitch_92
        :pswitch_8f
        :pswitch_8c
        :pswitch_89
        :pswitch_86
        :pswitch_83
        :pswitch_76
    .end packed-switch
.end method

.method public final q()V
    .registers 2

    const/4 v0, 0x1

    iput-boolean v0, p0, Lz5/ky0;->G:Z

    invoke-virtual {p0}, Lz5/ky0;->k()Z

    move-result v0

    if-eqz v0, :cond_18

    iget-object v0, p0, Lz5/ky0;->f:Lz5/ls0;

    .line 1
    iget-object v0, v0, Lz5/ls0;->f:Lz5/or0;

    invoke-static {v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    invoke-virtual {v0}, Lz5/or0;->a()V

    .line 2
    iget-object v0, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    invoke-virtual {v0}, Landroid/media/AudioTrack;->play()V

    :cond_18
    return-void
.end method

.method public final r(Ljava/nio/ByteBuffer;JI)Z
    .registers 22

    move-object/from16 v1, p0

    move-object/from16 v0, p1

    move-wide/from16 v2, p2

    iget-object v4, v1, Lz5/ky0;->z:Ljava/nio/ByteBuffer;

    const/4 v5, 0x1

    const/4 v6, 0x0

    if-eqz v4, :cond_11

    if-ne v0, v4, :cond_f

    goto :goto_11

    :cond_f
    move v4, v6

    goto :goto_12

    :cond_11
    :goto_11
    move v4, v5

    :goto_12
    invoke-static {v4}, Lcom/google/android/gms/internal/ads/d;->e(Z)V

    iget-object v4, v1, Lz5/ky0;->l:Lz5/su0;

    const/4 v7, 0x0

    if-eqz v4, :cond_74

    invoke-virtual/range {p0 .. p0}, Lz5/ky0;->e()Z

    move-result v4

    if-nez v4, :cond_21

    return v6

    :cond_21
    iget-object v4, v1, Lz5/ky0;->l:Lz5/su0;

    iget-object v8, v1, Lz5/ky0;->m:Lz5/su0;

    invoke-static {v8}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    invoke-static {v4}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    iget v9, v8, Lz5/su0;->f:I

    iget v10, v4, Lz5/su0;->f:I

    if-ne v9, v10, :cond_64

    iget v9, v8, Lz5/su0;->d:I

    iget v10, v4, Lz5/su0;->d:I

    if-ne v9, v10, :cond_64

    iget v9, v8, Lz5/su0;->e:I

    iget v10, v4, Lz5/su0;->e:I

    if-ne v9, v10, :cond_64

    iget v8, v8, Lz5/su0;->c:I

    iget v9, v4, Lz5/su0;->c:I

    if-ne v8, v9, :cond_64

    iput-object v4, v1, Lz5/ky0;->m:Lz5/su0;

    iput-object v7, v1, Lz5/ky0;->l:Lz5/su0;

    iget-object v4, v1, Lz5/ky0;->n:Landroid/media/AudioTrack;

    invoke-static {v4}, Lz5/ky0;->m(Landroid/media/AudioTrack;)Z

    move-result v4

    if-eqz v4, :cond_71

    iget-object v4, v1, Lz5/ky0;->n:Landroid/media/AudioTrack;

    invoke-virtual {v4}, Landroid/media/AudioTrack;->setOffloadEndOfStream()V

    iget-object v4, v1, Lz5/ky0;->n:Landroid/media/AudioTrack;

    iget-object v8, v1, Lz5/ky0;->m:Lz5/su0;

    iget-object v8, v8, Lz5/su0;->a:Lz5/x2;

    iget v9, v8, Lz5/x2;->A:I

    iget v8, v8, Lz5/x2;->B:I

    invoke-virtual {v4, v9, v8}, Landroid/media/AudioTrack;->setOffloadDelayPadding(II)V

    iput-boolean v5, v1, Lz5/ky0;->L:Z

    goto :goto_71

    :cond_64
    invoke-virtual/range {p0 .. p0}, Lz5/ky0;->n()V

    invoke-virtual/range {p0 .. p0}, Lz5/ky0;->s()Z

    move-result v4

    if-eqz v4, :cond_6e

    return v6

    :cond_6e
    invoke-virtual/range {p0 .. p0}, Lz5/ky0;->t()V

    :cond_71
    :goto_71
    invoke-virtual {v1, v2, v3}, Lz5/ky0;->i(J)V

    :cond_74
    invoke-virtual/range {p0 .. p0}, Lz5/ky0;->k()Z

    move-result v4

    if-nez v4, :cond_f3

    :try_start_7a
    iget-object v4, v1, Lz5/ky0;->e:Landroid/os/ConditionVariable;

    invoke-virtual {v4}, Landroid/os/ConditionVariable;->block()V
    :try_end_7f
    .catch Lz5/fp0; {:try_start_7a .. :try_end_7f} :catch_ec

    :try_start_7f
    iget-object v4, v1, Lz5/ky0;->m:Lz5/su0;
    :try_end_81
    .catch Lz5/fp0; {:try_start_7f .. :try_end_81} :catch_e3

    invoke-static {v4}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    :try_start_84
    iget-object v8, v1, Lz5/ky0;->o:Lz5/ch1;

    iget v9, v1, Lz5/ky0;->I:I

    invoke-virtual {v4, v6, v8, v9}, Lz5/su0;->b(ZLz5/ch1;I)Landroid/media/AudioTrack;

    move-result-object v4
    :try_end_8c
    .catch Lz5/fp0; {:try_start_84 .. :try_end_8c} :catch_e3

    :try_start_8c
    iput-object v4, v1, Lz5/ky0;->n:Landroid/media/AudioTrack;

    invoke-static {v4}, Lz5/ky0;->m(Landroid/media/AudioTrack;)Z

    move-result v4

    if-eqz v4, :cond_bd

    iget-object v4, v1, Lz5/ky0;->n:Landroid/media/AudioTrack;

    iget-object v8, v1, Lz5/ky0;->h:Lz5/yx0;

    if-nez v8, :cond_a1

    new-instance v8, Lz5/yx0;

    invoke-direct {v8, v1}, Lz5/yx0;-><init>(Lz5/ky0;)V

    iput-object v8, v1, Lz5/ky0;->h:Lz5/yx0;

    :cond_a1
    iget-object v8, v1, Lz5/ky0;->h:Lz5/yx0;

    .line 1
    iget-object v9, v8, Lz5/yx0;->a:Landroid/os/Handler;

    .line 2
    new-instance v10, Lo5/n;

    const/4 v11, 0x2

    invoke-direct {v10, v9, v11}, Lo5/n;-><init>(Landroid/os/Handler;I)V

    .line 3
    iget-object v8, v8, Lz5/yx0;->b:Landroid/media/AudioTrack$StreamEventCallback;

    invoke-virtual {v4, v10, v8}, Landroid/media/AudioTrack;->registerStreamEventCallback(Ljava/util/concurrent/Executor;Landroid/media/AudioTrack$StreamEventCallback;)V

    .line 4
    iget-object v4, v1, Lz5/ky0;->n:Landroid/media/AudioTrack;

    iget-object v8, v1, Lz5/ky0;->m:Lz5/su0;

    iget-object v8, v8, Lz5/su0;->a:Lz5/x2;

    iget v9, v8, Lz5/x2;->A:I

    iget v8, v8, Lz5/x2;->B:I

    invoke-virtual {v4, v9, v8}, Landroid/media/AudioTrack;->setOffloadDelayPadding(II)V

    :cond_bd
    iget-object v4, v1, Lz5/ky0;->n:Landroid/media/AudioTrack;

    invoke-virtual {v4}, Landroid/media/AudioTrack;->getAudioSessionId()I

    move-result v4

    iput v4, v1, Lz5/ky0;->I:I

    iget-object v8, v1, Lz5/ky0;->f:Lz5/ls0;

    iget-object v9, v1, Lz5/ky0;->n:Landroid/media/AudioTrack;

    iget-object v4, v1, Lz5/ky0;->m:Lz5/su0;

    invoke-static {v4}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    iget v11, v4, Lz5/su0;->f:I

    iget v12, v4, Lz5/su0;->c:I

    const/4 v10, 0x0

    iget v13, v4, Lz5/su0;->g:I

    invoke-virtual/range {v8 .. v13}, Lz5/ls0;->a(Landroid/media/AudioTrack;ZIII)V

    invoke-virtual/range {p0 .. p0}, Lz5/ky0;->f()V

    iget-object v4, v1, Lz5/ky0;->J:Lz5/op1;

    invoke-static {v4}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    iput-boolean v5, v1, Lz5/ky0;->u:Z

    goto :goto_f3

    :catch_e3
    move-exception v0

    iget-object v2, v1, Lz5/ky0;->k:Lz5/fz0;

    if-eqz v2, :cond_eb

    invoke-virtual {v2, v0}, Lz5/fz0;->a(Ljava/lang/Exception;)V

    :cond_eb
    throw v0
    :try_end_ec
    .catch Lz5/fp0; {:try_start_8c .. :try_end_ec} :catch_ec

    :catch_ec
    move-exception v0

    iget-object v2, v1, Lz5/ky0;->i:Lz5/yu1;

    invoke-virtual {v2, v0}, Lz5/yu1;->m(Ljava/lang/Exception;)V

    return v6

    :cond_f3
    :goto_f3
    iget-object v4, v1, Lz5/ky0;->i:Lz5/yu1;

    .line 5
    iput-object v7, v4, Lz5/yu1;->r:Ljava/lang/Object;

    .line 6
    iget-boolean v4, v1, Lz5/ky0;->u:Z

    const-wide/16 v8, 0x0

    if-eqz v4, :cond_111

    invoke-static {v8, v9, v2, v3}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v10

    iput-wide v10, v1, Lz5/ky0;->v:J

    iput-boolean v6, v1, Lz5/ky0;->t:Z

    iput-boolean v6, v1, Lz5/ky0;->u:Z

    invoke-virtual {v1, v2, v3}, Lz5/ky0;->i(J)V

    iget-boolean v4, v1, Lz5/ky0;->G:Z

    if-eqz v4, :cond_111

    invoke-virtual/range {p0 .. p0}, Lz5/ky0;->q()V

    :cond_111
    iget-object v4, v1, Lz5/ky0;->f:Lz5/ls0;

    invoke-virtual/range {p0 .. p0}, Lz5/ky0;->l()J

    move-result-wide v10

    .line 7
    iget-object v12, v4, Lz5/ls0;->c:Landroid/media/AudioTrack;

    invoke-static {v12}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    invoke-virtual {v12}, Landroid/media/AudioTrack;->getPlayState()I

    move-result v12

    iget-boolean v13, v4, Lz5/ls0;->o:Z

    .line 8
    invoke-virtual {v4}, Lz5/ls0;->c()J

    move-result-wide v14

    cmp-long v10, v10, v14

    if-gtz v10, :cond_12c

    move v10, v6

    goto :goto_12d

    :cond_12c
    move v10, v5

    .line 9
    :goto_12d
    iput-boolean v10, v4, Lz5/ls0;->o:Z

    if-eqz v13, :cond_158

    if-nez v10, :cond_158

    if-eq v12, v5, :cond_158

    iget-object v10, v4, Lz5/ls0;->a:Lz5/zw0;

    iget v12, v4, Lz5/ls0;->e:I

    iget-wide v13, v4, Lz5/ls0;->h:J

    invoke-static {v13, v14}, Lz5/v1;->a(J)J

    move-result-wide v13

    iget-object v4, v10, Lz5/zw0;->a:Lz5/ky0;

    .line 10
    iget-object v4, v4, Lz5/ky0;->k:Lz5/fz0;

    if-eqz v4, :cond_158

    .line 11
    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v15

    iget-object v4, v10, Lz5/zw0;->a:Lz5/ky0;

    .line 12
    iget-wide v10, v4, Lz5/ky0;->K:J

    .line 13
    iget-object v4, v4, Lz5/ky0;->k:Lz5/fz0;

    .line 14
    iget-object v4, v4, Lz5/fz0;->a:Lz5/wz0;

    .line 15
    iget-object v4, v4, Lz5/wz0;->Q0:Landroidx/appcompat/widget/n;

    sub-long/2addr v15, v10

    move-object v11, v4

    .line 16
    invoke-virtual/range {v11 .. v16}, Landroidx/appcompat/widget/n;->t(IJJ)V

    .line 17
    :cond_158
    iget-object v4, v1, Lz5/ky0;->z:Ljava/nio/ByteBuffer;

    if-nez v4, :cond_1f4

    invoke-virtual/range {p1 .. p1}, Ljava/nio/ByteBuffer;->order()Ljava/nio/ByteOrder;

    move-result-object v4

    sget-object v10, Ljava/nio/ByteOrder;->LITTLE_ENDIAN:Ljava/nio/ByteOrder;

    if-ne v4, v10, :cond_166

    move v4, v5

    goto :goto_167

    :cond_166
    move v4, v6

    :goto_167
    invoke-static {v4}, Lcom/google/android/gms/internal/ads/d;->e(Z)V

    invoke-virtual/range {p1 .. p1}, Ljava/nio/ByteBuffer;->hasRemaining()Z

    move-result v4

    if-nez v4, :cond_171

    return v5

    :cond_171
    iget-object v4, v1, Lz5/ky0;->m:Lz5/su0;

    invoke-static {v4}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v4, v1, Lz5/ky0;->p:Lz5/qv0;

    if-eqz v4, :cond_186

    invoke-virtual/range {p0 .. p0}, Lz5/ky0;->e()Z

    move-result v4

    if-nez v4, :cond_181

    return v6

    :cond_181
    invoke-virtual {v1, v2, v3}, Lz5/ky0;->i(J)V

    iput-object v7, v1, Lz5/ky0;->p:Lz5/qv0;

    :cond_186
    iget-wide v10, v1, Lz5/ky0;->v:J

    iget-object v4, v1, Lz5/ky0;->m:Lz5/su0;

    .line 18
    invoke-static {v4}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    iget-wide v12, v1, Lz5/ky0;->r:J

    iget v14, v4, Lz5/su0;->b:I

    int-to-long v14, v14

    div-long/2addr v12, v14

    .line 19
    iget-object v14, v1, Lz5/ky0;->b:Lz5/z11;

    .line 20
    iget-wide v14, v14, Lz5/z11;->o:J

    sub-long/2addr v12, v14

    const-wide/32 v14, 0xf4240

    mul-long/2addr v12, v14

    .line 21
    iget-object v4, v4, Lz5/su0;->a:Lz5/x2;

    iget v4, v4, Lz5/x2;->y:I

    int-to-long v14, v4

    div-long/2addr v12, v14

    add-long/2addr v12, v10

    iget-boolean v4, v1, Lz5/ky0;->t:Z

    if-nez v4, :cond_1c0

    sub-long v10, v12, v2

    invoke-static {v10, v11}, Ljava/lang/Math;->abs(J)J

    move-result-wide v10

    const-wide/32 v14, 0x30d40

    cmp-long v4, v10, v14

    if-lez v4, :cond_1c0

    iget-object v4, v1, Lz5/ky0;->k:Lz5/fz0;

    new-instance v10, Lz5/yp0;

    invoke-direct {v10, v2, v3, v12, v13}, Lz5/yp0;-><init>(JJ)V

    invoke-virtual {v4, v10}, Lz5/fz0;->a(Ljava/lang/Exception;)V

    iput-boolean v5, v1, Lz5/ky0;->t:Z

    :cond_1c0
    iget-boolean v4, v1, Lz5/ky0;->t:Z

    if-eqz v4, :cond_1e3

    invoke-virtual/range {p0 .. p0}, Lz5/ky0;->e()Z

    move-result v4

    if-nez v4, :cond_1cb

    return v6

    :cond_1cb
    sub-long v10, v2, v12

    iget-wide v12, v1, Lz5/ky0;->v:J

    add-long/2addr v12, v10

    iput-wide v12, v1, Lz5/ky0;->v:J

    iput-boolean v6, v1, Lz5/ky0;->t:Z

    invoke-virtual {v1, v2, v3}, Lz5/ky0;->i(J)V

    iget-object v4, v1, Lz5/ky0;->k:Lz5/fz0;

    if-eqz v4, :cond_1e3

    cmp-long v10, v10, v8

    if-eqz v10, :cond_1e3

    iget-object v4, v4, Lz5/fz0;->a:Lz5/wz0;

    .line 22
    iput-boolean v5, v4, Lz5/wz0;->X0:Z

    .line 23
    :cond_1e3
    iget-object v4, v1, Lz5/ky0;->m:Lz5/su0;

    invoke-static {v4}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    iget-wide v10, v1, Lz5/ky0;->r:J

    invoke-virtual/range {p1 .. p1}, Ljava/nio/ByteBuffer;->remaining()I

    move-result v4

    int-to-long v12, v4

    add-long/2addr v10, v12

    iput-wide v10, v1, Lz5/ky0;->r:J

    iput-object v0, v1, Lz5/ky0;->z:Ljava/nio/ByteBuffer;

    :cond_1f4
    invoke-virtual {v1, v2, v3}, Lz5/ky0;->c(J)V

    iget-object v0, v1, Lz5/ky0;->z:Ljava/nio/ByteBuffer;

    invoke-virtual {v0}, Ljava/nio/ByteBuffer;->hasRemaining()Z

    move-result v0

    if-nez v0, :cond_202

    iput-object v7, v1, Lz5/ky0;->z:Ljava/nio/ByteBuffer;

    return v5

    :cond_202
    iget-object v0, v1, Lz5/ky0;->f:Lz5/ls0;

    invoke-virtual/range {p0 .. p0}, Lz5/ky0;->l()J

    move-result-wide v2

    .line 24
    iget-wide v10, v0, Lz5/ls0;->w:J

    const-wide v12, -0x7fffffffffffffffL    # -4.9E-324

    cmp-long v4, v10, v12

    if-eqz v4, :cond_226

    cmp-long v2, v2, v8

    if-lez v2, :cond_226

    invoke-static {}, Landroid/os/SystemClock;->elapsedRealtime()J

    move-result-wide v2

    iget-wide v7, v0, Lz5/ls0;->w:J

    sub-long/2addr v2, v7

    const-wide/16 v7, 0xc8

    cmp-long v0, v2, v7

    if-ltz v0, :cond_226

    move v0, v5

    goto :goto_227

    :cond_226
    move v0, v6

    :goto_227
    if-eqz v0, :cond_234

    const-string v0, "DefaultAudioSink"

    const-string v2, "Resetting stalled audio track"

    .line 25
    invoke-static {v0, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    invoke-virtual/range {p0 .. p0}, Lz5/ky0;->t()V

    return v5

    :cond_234
    return v6
.end method

.method public final s()Z
    .registers 7

    invoke-virtual {p0}, Lz5/ky0;->k()Z

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_1c

    iget-object v0, p0, Lz5/ky0;->f:Lz5/ls0;

    invoke-virtual {p0}, Lz5/ky0;->l()J

    move-result-wide v2

    .line 1
    invoke-virtual {v0}, Lz5/ls0;->c()J

    move-result-wide v4

    cmp-long v0, v2, v4

    const/4 v2, 0x1

    if-gtz v0, :cond_18

    move v0, v1

    goto :goto_19

    :cond_18
    move v0, v2

    :goto_19
    if-eqz v0, :cond_1c

    return v2

    :cond_1c
    return v1
.end method

.method public final t()V
    .registers 13

    invoke-virtual {p0}, Lz5/ky0;->k()Z

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_ad

    const-wide/16 v2, 0x0

    iput-wide v2, p0, Lz5/ky0;->r:J

    iput-wide v2, p0, Lz5/ky0;->s:J

    const/4 v0, 0x0

    iput-boolean v0, p0, Lz5/ky0;->L:Z

    new-instance v11, Lz5/qv0;

    invoke-virtual {p0}, Lz5/ky0;->h()Lz5/qv0;

    move-result-object v4

    iget-object v5, v4, Lz5/qv0;->a:Lz5/u3;

    invoke-virtual {p0}, Lz5/ky0;->h()Lz5/qv0;

    move-result-object v4

    iget-boolean v6, v4, Lz5/qv0;->b:Z

    const-wide/16 v7, 0x0

    const-wide/16 v9, 0x0

    move-object v4, v11

    invoke-direct/range {v4 .. v10}, Lz5/qv0;-><init>(Lz5/u3;ZJJ)V

    iput-object v11, p0, Lz5/ky0;->q:Lz5/qv0;

    iput-wide v2, p0, Lz5/ky0;->v:J

    iput-object v1, p0, Lz5/ky0;->p:Lz5/qv0;

    iget-object v4, p0, Lz5/ky0;->g:Ljava/util/ArrayDeque;

    invoke-virtual {v4}, Ljava/util/ArrayDeque;->clear()V

    iput-object v1, p0, Lz5/ky0;->z:Ljava/nio/ByteBuffer;

    iput-object v1, p0, Lz5/ky0;->A:Ljava/nio/ByteBuffer;

    iput-boolean v0, p0, Lz5/ky0;->F:Z

    iput-boolean v0, p0, Lz5/ky0;->E:Z

    const/4 v4, -0x1

    iput v4, p0, Lz5/ky0;->D:I

    iget-object v4, p0, Lz5/ky0;->b:Lz5/z11;

    .line 1
    iput-wide v2, v4, Lz5/z11;->o:J

    .line 2
    invoke-virtual {p0}, Lz5/ky0;->b()V

    iget-object v4, p0, Lz5/ky0;->f:Lz5/ls0;

    .line 3
    iget-object v4, v4, Lz5/ls0;->c:Landroid/media/AudioTrack;

    invoke-static {v4}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    invoke-virtual {v4}, Landroid/media/AudioTrack;->getPlayState()I

    move-result v4

    const/4 v5, 0x3

    if-ne v4, v5, :cond_53

    const/4 v4, 0x1

    goto :goto_54

    :cond_53
    move v4, v0

    :goto_54
    if-eqz v4, :cond_5b

    .line 4
    iget-object v4, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    invoke-virtual {v4}, Landroid/media/AudioTrack;->pause()V

    :cond_5b
    iget-object v4, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    invoke-static {v4}, Lz5/ky0;->m(Landroid/media/AudioTrack;)Z

    move-result v4

    if-eqz v4, :cond_74

    iget-object v4, p0, Lz5/ky0;->h:Lz5/yx0;

    invoke-static {v4}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    iget-object v5, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    .line 5
    iget-object v6, v4, Lz5/yx0;->b:Landroid/media/AudioTrack$StreamEventCallback;

    invoke-virtual {v5, v6}, Landroid/media/AudioTrack;->unregisterStreamEventCallback(Landroid/media/AudioTrack$StreamEventCallback;)V

    iget-object v4, v4, Lz5/yx0;->a:Landroid/os/Handler;

    invoke-virtual {v4, v1}, Landroid/os/Handler;->removeCallbacksAndMessages(Ljava/lang/Object;)V

    .line 6
    :cond_74
    iget-object v4, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    iput-object v1, p0, Lz5/ky0;->n:Landroid/media/AudioTrack;

    sget v5, Lz5/r7;->a:I

    const/16 v6, 0x15

    if-ge v5, v6, :cond_84

    iget-boolean v5, p0, Lz5/ky0;->H:Z

    if-nez v5, :cond_84

    iput v0, p0, Lz5/ky0;->I:I

    :cond_84
    iget-object v5, p0, Lz5/ky0;->l:Lz5/su0;

    if-eqz v5, :cond_8c

    iput-object v5, p0, Lz5/ky0;->m:Lz5/su0;

    iput-object v1, p0, Lz5/ky0;->l:Lz5/su0;

    :cond_8c
    iget-object v5, p0, Lz5/ky0;->f:Lz5/ls0;

    .line 7
    iput-wide v2, v5, Lz5/ls0;->k:J

    iput v0, v5, Lz5/ls0;->u:I

    iput v0, v5, Lz5/ls0;->t:I

    iput-wide v2, v5, Lz5/ls0;->l:J

    iput-wide v2, v5, Lz5/ls0;->A:J

    iput-wide v2, v5, Lz5/ls0;->D:J

    iput-boolean v0, v5, Lz5/ls0;->j:Z

    .line 8
    iput-object v1, v5, Lz5/ls0;->c:Landroid/media/AudioTrack;

    iput-object v1, v5, Lz5/ls0;->f:Lz5/or0;

    .line 9
    iget-object v0, p0, Lz5/ky0;->e:Landroid/os/ConditionVariable;

    invoke-virtual {v0}, Landroid/os/ConditionVariable;->close()V

    new-instance v0, Lz5/hu0;

    invoke-direct {v0, p0, v4}, Lz5/hu0;-><init>(Lz5/ky0;Landroid/media/AudioTrack;)V

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    :cond_ad
    iget-object v0, p0, Lz5/ky0;->j:Lz5/yu1;

    .line 10
    iput-object v1, v0, Lz5/yu1;->r:Ljava/lang/Object;

    .line 11
    iget-object v0, p0, Lz5/ky0;->i:Lz5/yu1;

    .line 12
    iput-object v1, v0, Lz5/yu1;->r:Ljava/lang/Object;

    return-void
.end method

.method public final u()V
    .registers 6

    invoke-virtual {p0}, Lz5/ky0;->t()V

    iget-object v0, p0, Lz5/ky0;->c:[Lz5/ai0;

    array-length v1, v0

    const/4 v2, 0x0

    move v3, v2

    :goto_8
    if-ge v3, v1, :cond_12

    aget-object v4, v0, v3

    invoke-interface {v4}, Lz5/ai0;->zzh()V

    add-int/lit8 v3, v3, 0x1

    goto :goto_8

    :cond_12
    iget-object v0, p0, Lz5/ky0;->d:[Lz5/ai0;

    array-length v1, v0

    move v1, v2

    :goto_16
    if-gtz v1, :cond_20

    aget-object v3, v0, v1

    invoke-interface {v3}, Lz5/ai0;->zzh()V

    add-int/lit8 v1, v1, 0x1

    goto :goto_16

    :cond_20
    iput-boolean v2, p0, Lz5/ky0;->G:Z

    return-void
.end method
