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


# instance fields
.field public A:I

.field public B:J

.field public C:I

.field public D:J

.field public E:I

.field public F:J

.field public G:J

.field public H:J

.field public I:F

.field public J:[Lz5/v8;

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

.field public L:Ljava/nio/ByteBuffer;

.field public M:Ljava/nio/ByteBuffer;

.field public N:[B

.field public O:I

.field public P:I

.field public Q:Z

.field public R:Z

.field public S:I

.field public T:Z

.field public U:J

.field public final a:Lz5/h9;

.field public final b:Lz5/m9;

.field public final c:[Lz5/v8;

.field public final d:Lz5/i9;

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

.field public final f:[J

.field public final g:Lz5/a9;

.field public final h:Ljava/util/LinkedList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/LinkedList<",
            "Lz5/e9;",
            ">;"
        }
    .end annotation
.end field

.field public i:Landroid/media/AudioTrack;

.field public j:I

.field public k:I

.field public l:I

.field public m:I

.field public n:I

.field public o:J

.field public p:Lz5/l8;

.field public q:Lz5/l8;

.field public r:J

.field public s:J

.field public t:I

.field public u:I

.field public v:J

.field public w:J

.field public x:Z

.field public y:J

.field public z:Ljava/lang/reflect/Method;


# direct methods
.method public constructor <init>([Lz5/v8;Lz5/i9;)V
    .registers 8

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

    iput-object p2, p0, Lz5/g9;->d:Lz5/i9;

    new-instance p2, Landroid/os/ConditionVariable;

    const/4 v0, 0x1

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

    iput-object p2, p0, Lz5/g9;->e:Landroid/os/ConditionVariable;

    sget p2, Lz5/be;->a:I

    const/16 v1, 0x12

    if-lt p2, v1, :cond_1e

    :try_start_13
    const-class p2, Landroid/media/AudioTrack;

    const-string v1, "getLatency"

    const/4 v2, 0x0

    invoke-virtual {p2, v1, v2}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object p2

    iput-object p2, p0, Lz5/g9;->z:Ljava/lang/reflect/Method;
    :try_end_1e
    .catch Ljava/lang/NoSuchMethodException; {:try_start_13 .. :try_end_1e} :catch_1e

    :catch_1e
    :cond_1e
    sget p2, Lz5/be;->a:I

    const/16 v1, 0x13

    if-lt p2, v1, :cond_2a

    new-instance p2, Lz5/b9;

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

    goto :goto_2f

    :cond_2a
    new-instance p2, Lz5/a9;

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

    :goto_2f
    iput-object p2, p0, Lz5/g9;->g:Lz5/a9;

    new-instance p2, Lz5/h9;

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

    iput-object p2, p0, Lz5/g9;->a:Lz5/h9;

    new-instance v1, Lz5/m9;

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

    iput-object v1, p0, Lz5/g9;->b:Lz5/m9;

    const/4 v2, 0x3

    new-array v2, v2, [Lz5/v8;

    iput-object v2, p0, Lz5/g9;->c:[Lz5/v8;

    new-instance v3, Lz5/k9;

    invoke-direct {v3}, Lz5/k9;-><init>()V

    const/4 v4, 0x0

    aput-object v3, v2, v4

    aput-object p2, v2, v0

    const/4 p2, 0x2

    invoke-static {p1, v4, v2, p2, v4}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    aput-object v1, v2, p2

    const/16 p1, 0xa

    new-array p1, p1, [J

    iput-object p1, p0, Lz5/g9;->f:[J

    const/high16 p1, 0x3f800000    # 1.0f

    iput p1, p0, Lz5/g9;->I:F

    iput v4, p0, Lz5/g9;->E:I

    iput v4, p0, Lz5/g9;->S:I

    sget-object p1, Lz5/l8;->c:Lz5/l8;

    iput-object p1, p0, Lz5/g9;->q:Lz5/l8;

    const/4 p1, -0x1

    iput p1, p0, Lz5/g9;->P:I

    new-array p1, v4, [Lz5/v8;

    iput-object p1, p0, Lz5/g9;->J:[Lz5/v8;

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

    iput-object p1, p0, Lz5/g9;->K:[Ljava/nio/ByteBuffer;

    new-instance p1, Ljava/util/LinkedList;

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

    iput-object p1, p0, Lz5/g9;->h:Ljava/util/LinkedList;

    return-void
.end method


# virtual methods
.method public final a(Ljava/lang/String;IIII[I)V
    .registers 13

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

    move-result p1

    iput p1, p0, Lz5/g9;->A:I

    iget-object p1, p0, Lz5/g9;->a:Lz5/h9;

    .line 1
    iput-object p6, p1, Lz5/h9;->d:[I

    .line 2
    iget-object p1, p0, Lz5/g9;->c:[Lz5/v8;

    const/4 p5, 0x0

    move p6, p5

    move v0, p6

    :goto_f
    const/4 v1, 0x3

    const/4 v2, 0x2

    if-ge p6, v1, :cond_32

    aget-object v1, p1, p6

    :try_start_15
    invoke-interface {v1, p3, p2, p4}, Lz5/v8;->a(III)Z

    move-result v3
    :try_end_19
    .catch Lz5/u8; {:try_start_15 .. :try_end_19} :catch_2b

    or-int/2addr v0, v3

    invoke-interface {v1}, Lz5/v8;->zzb()Z

    move-result v3

    if-eqz v3, :cond_28

    invoke-interface {v1}, Lz5/v8;->zzc()I

    move-result p2

    invoke-interface {v1}, Lz5/v8;->zzd()I

    move p4, v2

    :cond_28
    add-int/lit8 p6, p6, 0x1

    goto :goto_f

    :catch_2b
    move-exception p1

    new-instance p2, Lz5/c9;

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

    throw p2

    :cond_32
    if-eqz v0, :cond_37

    invoke-virtual {p0}, Lz5/g9;->g()V

    :cond_37
    const/16 p1, 0xfc

    packed-switch p2, :pswitch_data_fc

    new-instance p1, Lz5/c9;

    const/16 p3, 0x26

    const-string p4, "Unsupported channel count: "

    invoke-static {p3, p4, p2}, Le/f;->a(ILjava/lang/String;I)Ljava/lang/String;

    move-result-object p2

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

    throw p1

    :pswitch_4a
    sget p6, Lz5/x7;->a:I

    goto :goto_5f

    :pswitch_4d
    const/16 p6, 0x4fc

    goto :goto_5f

    :pswitch_50
    move p6, p1

    goto :goto_5f

    :pswitch_52
    const/16 p6, 0xdc

    goto :goto_5f

    :pswitch_55
    const/16 p6, 0xcc

    goto :goto_5f

    :pswitch_58
    const/16 p6, 0x1c

    goto :goto_5f

    :pswitch_5b
    const/16 p6, 0xc

    goto :goto_5f

    :pswitch_5e
    const/4 p6, 0x4

    :goto_5f
    sget v3, Lz5/be;->a:I

    const/16 v4, 0x17

    if-gt v3, v4, :cond_85

    sget-object v4, Lz5/be;->b:Ljava/lang/String;

    const-string v5, "foster"

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

    move-result v4

    if-eqz v4, :cond_85

    sget-object v4, Lz5/be;->c:Ljava/lang/String;

    const-string v5, "NVIDIA"

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

    move-result v4

    if-eqz v4, :cond_85

    if-eq p2, v1, :cond_86

    const/4 v1, 0x5

    if-eq p2, v1, :cond_86

    const/4 p1, 0x7

    if-eq p2, p1, :cond_82

    goto :goto_85

    :cond_82
    sget p1, Lz5/x7;->a:I

    goto :goto_86

    :cond_85
    :goto_85
    move p1, p6

    :cond_86
    :goto_86
    const/16 p6, 0x19

    if-gt v3, p6, :cond_91

    sget-object p6, Lz5/be;->b:Ljava/lang/String;

    const-string v1, "fugu"

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

    :cond_91
    if-nez v0, :cond_a7

    invoke-virtual {p0}, Lz5/g9;->l()Z

    move-result p6

    if-eqz p6, :cond_a7

    iget p6, p0, Lz5/g9;->l:I

    if-ne p6, p4, :cond_a7

    iget p6, p0, Lz5/g9;->j:I

    if-ne p6, p3, :cond_a7

    iget p6, p0, Lz5/g9;->k:I

    if-eq p6, p1, :cond_a6

    goto :goto_a7

    :cond_a6
    return-void

    :cond_a7
    :goto_a7
    invoke-virtual {p0}, Lz5/g9;->f()V

    iput p4, p0, Lz5/g9;->l:I

    iput p3, p0, Lz5/g9;->j:I

    iput p1, p0, Lz5/g9;->k:I

    iput v2, p0, Lz5/g9;->m:I

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

    move-result p2

    iput p2, p0, Lz5/g9;->C:I

    iget p2, p0, Lz5/g9;->m:I

    invoke-static {p3, p1, p2}, Landroid/media/AudioTrack;->getMinBufferSize(III)I

    move-result p1

    const/4 p2, -0x2

    if-eq p1, p2, :cond_c2

    const/4 p5, 0x1

    :cond_c2
    invoke-static {p5}, Lcom/google/android/gms/internal/ads/r;->q(Z)V

    mul-int/lit8 p2, p1, 0x4

    const-wide/32 p3, 0x3d090

    invoke-virtual {p0, p3, p4}, Lz5/g9;->n(J)J

    move-result-wide p3

    long-to-int p3, p3

    iget p4, p0, Lz5/g9;->C:I

    mul-int/2addr p3, p4

    int-to-long p4, p1

    const-wide/32 v0, 0xb71b0

    invoke-virtual {p0, v0, v1}, Lz5/g9;->n(J)J

    move-result-wide v0

    iget p1, p0, Lz5/g9;->C:I

    int-to-long v2, p1

    mul-long/2addr v0, v2

    invoke-static {p4, p5, v0, v1}, Ljava/lang/Math;->max(JJ)J

    move-result-wide p4

    long-to-int p1, p4

    if-ge p2, p3, :cond_e7

    move p2, p3

    goto :goto_ea

    :cond_e7
    if-le p2, p1, :cond_ea

    move p2, p1

    :cond_ea
    :goto_ea
    iput p2, p0, Lz5/g9;->n:I

    iget p1, p0, Lz5/g9;->C:I

    div-int/2addr p2, p1

    int-to-long p1, p2

    invoke-virtual {p0, p1, p2}, Lz5/g9;->m(J)J

    move-result-wide p1

    iput-wide p1, p0, Lz5/g9;->o:J

    iget-object p1, p0, Lz5/g9;->q:Lz5/l8;

    invoke-virtual {p0, p1}, Lz5/g9;->e(Lz5/l8;)Lz5/l8;

    return-void

    :pswitch_data_fc
    .packed-switch 0x1
        :pswitch_5e
        :pswitch_5b
        :pswitch_58
        :pswitch_55
        :pswitch_52
        :pswitch_50
        :pswitch_4d
        :pswitch_4a
    .end packed-switch
.end method

.method public final b()V
    .registers 5

    const/4 v0, 0x1

    iput-boolean v0, p0, Lz5/g9;->R:Z

    invoke-virtual {p0}, Lz5/g9;->l()Z

    move-result v0

    if-eqz v0, :cond_17

    invoke-static {}, Ljava/lang/System;->nanoTime()J

    move-result-wide v0

    const-wide/16 v2, 0x3e8

    div-long/2addr v0, v2

    iput-wide v0, p0, Lz5/g9;->G:J

    iget-object v0, p0, Lz5/g9;->i:Landroid/media/AudioTrack;

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

    :cond_17
    return-void
.end method

.method public final c(Ljava/nio/ByteBuffer;J)Z
    .registers 24

    move-object/from16 v1, p0

    move-object/from16 v0, p1

    move-wide/from16 v2, p2

    iget-object v4, v1, Lz5/g9;->L:Ljava/nio/ByteBuffer;

    const/4 v5, 0x0

    const/4 v6, 0x1

    if-eqz v4, :cond_11

    if-ne v0, v4, :cond_f

    goto :goto_11

    :cond_f
    move v4, v5

    goto :goto_12

    :cond_11
    :goto_11
    move v4, v6

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

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

    move-result v4

    const/4 v7, 0x0

    if-nez v4, :cond_92

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

    invoke-virtual {v4}, Landroid/os/ConditionVariable;->block()V

    iget v15, v1, Lz5/g9;->S:I

    new-instance v4, Landroid/media/AudioTrack;

    const/4 v9, 0x3

    iget v10, v1, Lz5/g9;->j:I

    iget v11, v1, Lz5/g9;->k:I

    iget v12, v1, Lz5/g9;->m:I

    iget v13, v1, Lz5/g9;->n:I

    const/4 v14, 0x1

    if-nez v15, :cond_36

    move-object v8, v4

    invoke-direct/range {v8 .. v14}, Landroid/media/AudioTrack;-><init>(IIIIII)V

    goto :goto_3c

    :cond_36
    const/4 v9, 0x3

    const/4 v14, 0x1

    move-object v8, v4

    invoke-direct/range {v8 .. v15}, Landroid/media/AudioTrack;-><init>(IIIIIII)V

    :goto_3c
    iput-object v4, v1, Lz5/g9;->i:Landroid/media/AudioTrack;

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

    move-result v4

    if-ne v4, v6, :cond_7a

    iget-object v4, v1, Lz5/g9;->i:Landroid/media/AudioTrack;

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

    move-result v4

    iget v7, v1, Lz5/g9;->S:I

    if-eq v7, v4, :cond_62

    iput v4, v1, Lz5/g9;->S:I

    iget-object v4, v1, Lz5/g9;->d:Lz5/i9;

    iget-object v4, v4, Lz5/i9;->a:Lz5/j9;

    .line 1
    iget-object v4, v4, Lz5/j9;->Q:Landroidx/appcompat/widget/n;

    .line 2
    iget-object v7, v4, Landroidx/appcompat/widget/n;->s:Ljava/lang/Object;

    check-cast v7, Landroid/os/Handler;

    new-instance v8, Lz5/x8;

    invoke-direct {v8, v4, v6}, Lz5/x8;-><init>(Landroidx/appcompat/widget/n;I)V

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

    .line 3
    :cond_62
    iget-object v4, v1, Lz5/g9;->g:Lz5/a9;

    iget-object v7, v1, Lz5/g9;->i:Landroid/media/AudioTrack;

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

    move-result v8

    invoke-virtual {v4, v7, v8}, Lz5/a9;->a(Landroid/media/AudioTrack;Z)V

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

    iput-boolean v5, v1, Lz5/g9;->T:Z

    iget-boolean v4, v1, Lz5/g9;->R:Z

    if-eqz v4, :cond_92

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

    goto :goto_92

    :cond_7a
    :try_start_7a
    iget-object v0, v1, Lz5/g9;->i:Landroid/media/AudioTrack;

    invoke-virtual {v0}, Landroid/media/AudioTrack;->release()V
    :try_end_7f
    .catch Ljava/lang/Exception; {:try_start_7a .. :try_end_7f} :catch_84
    .catchall {:try_start_7a .. :try_end_7f} :catchall_80

    goto :goto_84

    :catchall_80
    move-exception v0

    iput-object v7, v1, Lz5/g9;->i:Landroid/media/AudioTrack;

    throw v0

    :catch_84
    :goto_84
    iput-object v7, v1, Lz5/g9;->i:Landroid/media/AudioTrack;

    new-instance v0, Lz5/d9;

    iget v2, v1, Lz5/g9;->j:I

    iget v3, v1, Lz5/g9;->k:I

    iget v5, v1, Lz5/g9;->n:I

    invoke-direct {v0, v4, v2, v3, v5}, Lz5/d9;-><init>(IIII)V

    throw v0

    :cond_92
    :goto_92
    invoke-virtual/range {p0 .. p0}, Lz5/g9;->p()Z

    move-result v4

    const/4 v7, 0x2

    const-wide/16 v8, 0x0

    if-eqz v4, :cond_ba

    iget-object v4, v1, Lz5/g9;->i:Landroid/media/AudioTrack;

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

    move-result v4

    if-ne v4, v7, :cond_a6

    iput-boolean v5, v1, Lz5/g9;->T:Z

    return v5

    :cond_a6
    iget-object v4, v1, Lz5/g9;->i:Landroid/media/AudioTrack;

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

    move-result v4

    if-ne v4, v6, :cond_ba

    iget-object v4, v1, Lz5/g9;->g:Lz5/a9;

    invoke-virtual {v4}, Lz5/a9;->b()J

    move-result-wide v10

    cmp-long v4, v10, v8

    if-nez v4, :cond_b9

    goto :goto_ba

    :cond_b9
    return v5

    :cond_ba
    :goto_ba
    iget-boolean v4, v1, Lz5/g9;->T:Z

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

    move-result v7

    iput-boolean v7, v1, Lz5/g9;->T:Z

    if-eqz v4, :cond_e7

    if-nez v7, :cond_e7

    iget-object v4, v1, Lz5/g9;->i:Landroid/media/AudioTrack;

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

    move-result v4

    if-eq v4, v6, :cond_e7

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

    move-result-wide v10

    iget-wide v12, v1, Lz5/g9;->U:J

    iget-object v4, v1, Lz5/g9;->d:Lz5/i9;

    iget v15, v1, Lz5/g9;->n:I

    iget-wide v8, v1, Lz5/g9;->o:J

    invoke-static {v8, v9}, Lz5/x7;->a(J)J

    move-result-wide v16

    iget-object v4, v4, Lz5/i9;->a:Lz5/j9;

    .line 4
    iget-object v14, v4, Lz5/j9;->Q:Landroidx/appcompat/widget/n;

    sub-long v18, v10, v12

    .line 5
    invoke-virtual/range {v14 .. v19}, Landroidx/appcompat/widget/n;->t(IJJ)V

    :cond_e7
    iget-object v4, v1, Lz5/g9;->L:Ljava/nio/ByteBuffer;

    if-nez v4, :cond_199

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

    move-result v4

    if-nez v4, :cond_f2

    return v6

    :cond_f2
    iget-object v4, v1, Lz5/g9;->p:Lz5/l8;

    if-eqz v4, :cond_120

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

    move-result v4

    if-nez v4, :cond_fd

    return v5

    :cond_fd
    iget-object v4, v1, Lz5/g9;->h:Ljava/util/LinkedList;

    new-instance v11, Lz5/e9;

    iget-object v6, v1, Lz5/g9;->p:Lz5/l8;

    const-wide/16 v7, 0x0

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

    move-result-wide v9

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

    move-result-wide v7

    invoke-virtual {v1, v7, v8}, Lz5/g9;->m(J)J

    move-result-wide v12

    move-object v5, v11

    move-wide v7, v9

    move-wide v9, v12

    invoke-direct/range {v5 .. v10}, Lz5/e9;-><init>(Lz5/l8;JJ)V

    invoke-virtual {v4, v11}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z

    const/4 v4, 0x0

    iput-object v4, v1, Lz5/g9;->p:Lz5/l8;

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

    :cond_120
    iget v4, v1, Lz5/g9;->E:I

    if-nez v4, :cond_130

    const-wide/16 v4, 0x0

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

    move-result-wide v4

    iput-wide v4, v1, Lz5/g9;->F:J

    const/4 v4, 0x1

    iput v4, v1, Lz5/g9;->E:I

    goto :goto_18d

    :cond_130
    const/4 v4, 0x1

    iget-wide v5, v1, Lz5/g9;->F:J

    iget-wide v7, v1, Lz5/g9;->B:J

    iget v9, v1, Lz5/g9;->A:I

    int-to-long v9, v9

    div-long/2addr v7, v9

    invoke-virtual {v1, v7, v8}, Lz5/g9;->m(J)J

    move-result-wide v7

    add-long/2addr v7, v5

    iget v5, v1, Lz5/g9;->E:I

    if-ne v5, v4, :cond_178

    sub-long v4, v7, v2

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

    move-result-wide v4

    const-wide/32 v9, 0x30d40

    cmp-long v4, v4, v9

    if-lez v4, :cond_178

    new-instance v4, Ljava/lang/StringBuilder;

    const/16 v5, 0x50

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

    const-string v5, "Discontinuity detected [expected "

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

    invoke-virtual {v4, v7, v8}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v5, ", got "

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

    invoke-virtual {v4, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const-string v5, "]"

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

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

    move-result-object v4

    const-string v5, "AudioTrack"

    invoke-static {v5, v4}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    const/4 v4, 0x2

    iput v4, v1, Lz5/g9;->E:I

    goto :goto_179

    :cond_178
    const/4 v4, 0x2

    :goto_179
    iget v5, v1, Lz5/g9;->E:I

    if-ne v5, v4, :cond_18d

    iget-wide v4, v1, Lz5/g9;->F:J

    sub-long v6, v2, v7

    add-long/2addr v6, v4

    iput-wide v6, v1, Lz5/g9;->F:J

    const/4 v4, 0x1

    iput v4, v1, Lz5/g9;->E:I

    iget-object v5, v1, Lz5/g9;->d:Lz5/i9;

    iget-object v5, v5, Lz5/i9;->a:Lz5/j9;

    .line 6
    iput-boolean v4, v5, Lz5/j9;->W:Z

    .line 7
    :cond_18d
    :goto_18d
    iget-wide v4, v1, Lz5/g9;->B:J

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

    move-result v6

    int-to-long v6, v6

    add-long/2addr v4, v6

    iput-wide v4, v1, Lz5/g9;->B:J

    iput-object v0, v1, Lz5/g9;->L:Ljava/nio/ByteBuffer;

    :cond_199
    invoke-virtual {v1, v2, v3}, Lz5/g9;->h(J)V

    iget-object v0, v1, Lz5/g9;->L:Ljava/nio/ByteBuffer;

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

    move-result v0

    if-nez v0, :cond_1a9

    const/4 v0, 0x0

    iput-object v0, v1, Lz5/g9;->L:Ljava/nio/ByteBuffer;

    const/4 v0, 0x1

    return v0

    :cond_1a9
    const/4 v0, 0x0

    return v0
.end method

.method public final d()Z
    .registers 8

    invoke-virtual {p0}, Lz5/g9;->l()Z

    move-result v0

    const/4 v1, 0x1

    const/4 v2, 0x0

    if-eqz v0, :cond_2f

    invoke-virtual {p0}, Lz5/g9;->o()J

    move-result-wide v3

    iget-object v0, p0, Lz5/g9;->g:Lz5/a9;

    invoke-virtual {v0}, Lz5/a9;->b()J

    move-result-wide v5

    cmp-long v0, v3, v5

    if-gtz v0, :cond_30

    invoke-virtual {p0}, Lz5/g9;->p()Z

    move-result v0

    if-eqz v0, :cond_2f

    iget-object v0, p0, Lz5/g9;->i:Landroid/media/AudioTrack;

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

    move-result v0

    const/4 v3, 0x2

    if-ne v0, v3, :cond_2f

    iget-object v0, p0, Lz5/g9;->i:Landroid/media/AudioTrack;

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

    move-result v0

    if-eqz v0, :cond_2e

    goto :goto_2f

    :cond_2e
    return v1

    :cond_2f
    :goto_2f
    move v1, v2

    :cond_30
    return v1
.end method

.method public final e(Lz5/l8;)Lz5/l8;
    .registers 7

    new-instance v0, Lz5/l8;

    iget-object v1, p0, Lz5/g9;->b:Lz5/m9;

    iget p1, p1, Lz5/l8;->a:F

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

    .line 1
    sget v2, Lz5/be;->a:I

    const/high16 v2, 0x41000000    # 8.0f

    .line 2
    invoke-static {p1, v2}, Ljava/lang/Math;->min(FF)F

    move-result p1

    const v3, 0x3dcccccd    # 0.1f

    invoke-static {v3, p1}, Ljava/lang/Math;->max(FF)F

    move-result p1

    .line 3
    iput p1, v1, Lz5/m9;->e:F

    .line 4
    iget-object v1, p0, Lz5/g9;->b:Lz5/m9;

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

    const/high16 v4, 0x3f800000    # 1.0f

    .line 5
    invoke-static {v4, v2}, Ljava/lang/Math;->min(FF)F

    move-result v2

    invoke-static {v3, v2}, Ljava/lang/Math;->max(FF)F

    move-result v2

    .line 6
    iput v2, v1, Lz5/m9;->f:F

    .line 7
    invoke-direct {v0, p1}, Lz5/l8;-><init>(F)V

    iget-object p1, p0, Lz5/g9;->p:Lz5/l8;

    if-nez p1, :cond_47

    iget-object p1, p0, Lz5/g9;->h:Ljava/util/LinkedList;

    invoke-virtual {p1}, Ljava/util/LinkedList;->isEmpty()Z

    move-result p1

    if-nez p1, :cond_45

    iget-object p1, p0, Lz5/g9;->h:Ljava/util/LinkedList;

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

    move-result-object p1

    check-cast p1, Lz5/e9;

    .line 8
    iget-object p1, p1, Lz5/e9;->a:Lz5/l8;

    goto :goto_47

    .line 9
    :cond_45
    iget-object p1, p0, Lz5/g9;->q:Lz5/l8;

    :cond_47
    :goto_47
    invoke-virtual {v0, p1}, Lz5/l8;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-nez p1, :cond_58

    invoke-virtual {p0}, Lz5/g9;->l()Z

    move-result p1

    if-eqz p1, :cond_56

    iput-object v0, p0, Lz5/g9;->p:Lz5/l8;

    goto :goto_58

    :cond_56
    iput-object v0, p0, Lz5/g9;->q:Lz5/l8;

    :cond_58
    :goto_58
    iget-object p1, p0, Lz5/g9;->q:Lz5/l8;

    return-object p1
.end method

.method public final f()V
    .registers 8

    invoke-virtual {p0}, Lz5/g9;->l()Z

    move-result v0

    if-eqz v0, :cond_87

    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lz5/g9;->B:J

    iput-wide v0, p0, Lz5/g9;->D:J

    const/4 v2, 0x0

    iget-object v3, p0, Lz5/g9;->p:Lz5/l8;

    const/4 v4, 0x0

    if-eqz v3, :cond_17

    iput-object v3, p0, Lz5/g9;->q:Lz5/l8;

    iput-object v4, p0, Lz5/g9;->p:Lz5/l8;

    goto :goto_2b

    :cond_17
    iget-object v3, p0, Lz5/g9;->h:Ljava/util/LinkedList;

    invoke-virtual {v3}, Ljava/util/LinkedList;->isEmpty()Z

    move-result v3

    if-nez v3, :cond_2b

    iget-object v3, p0, Lz5/g9;->h:Ljava/util/LinkedList;

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

    move-result-object v3

    check-cast v3, Lz5/e9;

    .line 1
    iget-object v3, v3, Lz5/e9;->a:Lz5/l8;

    .line 2
    iput-object v3, p0, Lz5/g9;->q:Lz5/l8;

    :cond_2b
    :goto_2b
    iget-object v3, p0, Lz5/g9;->h:Ljava/util/LinkedList;

    invoke-virtual {v3}, Ljava/util/LinkedList;->clear()V

    iput-wide v0, p0, Lz5/g9;->r:J

    iput-wide v0, p0, Lz5/g9;->s:J

    iput-object v4, p0, Lz5/g9;->L:Ljava/nio/ByteBuffer;

    iput-object v4, p0, Lz5/g9;->M:Ljava/nio/ByteBuffer;

    move v3, v2

    :goto_39
    iget-object v5, p0, Lz5/g9;->J:[Lz5/v8;

    array-length v6, v5

    if-ge v3, v6, :cond_4e

    aget-object v5, v5, v3

    invoke-interface {v5}, Lz5/v8;->zzi()V

    iget-object v6, p0, Lz5/g9;->K:[Ljava/nio/ByteBuffer;

    invoke-interface {v5}, Lz5/v8;->zzg()Ljava/nio/ByteBuffer;

    move-result-object v5

    aput-object v5, v6, v3

    add-int/lit8 v3, v3, 0x1

    goto :goto_39

    :cond_4e
    iput-boolean v2, p0, Lz5/g9;->Q:Z

    const/4 v3, -0x1

    iput v3, p0, Lz5/g9;->P:I

    iput v2, p0, Lz5/g9;->E:I

    iput-wide v0, p0, Lz5/g9;->H:J

    .line 3
    iput-wide v0, p0, Lz5/g9;->v:J

    iput v2, p0, Lz5/g9;->u:I

    iput v2, p0, Lz5/g9;->t:I

    iput-wide v0, p0, Lz5/g9;->w:J

    iput-boolean v2, p0, Lz5/g9;->x:Z

    iput-wide v0, p0, Lz5/g9;->y:J

    .line 4
    iget-object v0, p0, Lz5/g9;->i:Landroid/media/AudioTrack;

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

    move-result v0

    const/4 v1, 0x3

    if-ne v0, v1, :cond_71

    iget-object v0, p0, Lz5/g9;->i:Landroid/media/AudioTrack;

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

    :cond_71
    iget-object v0, p0, Lz5/g9;->i:Landroid/media/AudioTrack;

    iput-object v4, p0, Lz5/g9;->i:Landroid/media/AudioTrack;

    iget-object v1, p0, Lz5/g9;->g:Lz5/a9;

    invoke-virtual {v1, v4, v2}, Lz5/a9;->a(Landroid/media/AudioTrack;Z)V

    iget-object v1, p0, Lz5/g9;->e:Landroid/os/ConditionVariable;

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

    new-instance v1, Lz5/z8;

    invoke-direct {v1, p0, v0}, Lz5/z8;-><init>(Lz5/g9;Landroid/media/AudioTrack;)V

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

    :cond_87
    return-void
.end method

.method public final g()V
    .registers 7

    new-instance v0, Ljava/util/ArrayList;

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

    iget-object v1, p0, Lz5/g9;->c:[Lz5/v8;

    const/4 v2, 0x0

    move v3, v2

    :goto_9
    const/4 v4, 0x3

    if-ge v3, v4, :cond_1e

    aget-object v4, v1, v3

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

    move-result v5

    if-eqz v5, :cond_18

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

    goto :goto_1b

    :cond_18
    invoke-interface {v4}, Lz5/v8;->zzi()V

    :goto_1b
    add-int/lit8 v3, v3, 0x1

    goto :goto_9

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

    move-result v1

    new-array v3, v1, [Lz5/v8;

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

    move-result-object v0

    check-cast v0, [Lz5/v8;

    iput-object v0, p0, Lz5/g9;->J:[Lz5/v8;

    new-array v0, v1, [Ljava/nio/ByteBuffer;

    iput-object v0, p0, Lz5/g9;->K:[Ljava/nio/ByteBuffer;

    :goto_30
    if-ge v2, v1, :cond_44

    iget-object v0, p0, Lz5/g9;->J:[Lz5/v8;

    aget-object v0, v0, v2

    invoke-interface {v0}, Lz5/v8;->zzi()V

    iget-object v3, p0, Lz5/g9;->K:[Ljava/nio/ByteBuffer;

    invoke-interface {v0}, Lz5/v8;->zzg()Ljava/nio/ByteBuffer;

    move-result-object v0

    aput-object v0, v3, v2

    add-int/lit8 v2, v2, 0x1

    goto :goto_30

    :cond_44
    return-void
.end method

.method public final h(J)V
    .registers 8

    iget-object v0, p0, Lz5/g9;->J:[Lz5/v8;

    array-length v0, v0

    move v1, v0

    :goto_4
    if-ltz v1, :cond_3d

    if-lez v1, :cond_f

    iget-object v2, p0, Lz5/g9;->K:[Ljava/nio/ByteBuffer;

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

    aget-object v2, v2, v3

    goto :goto_15

    :cond_f
    iget-object v2, p0, Lz5/g9;->L:Ljava/nio/ByteBuffer;

    if-nez v2, :cond_15

    sget-object v2, Lz5/v8;->a:Ljava/nio/ByteBuffer;

    :cond_15
    :goto_15
    if-ne v1, v0, :cond_1b

    invoke-virtual {p0, v2, p1, p2}, Lz5/g9;->i(Ljava/nio/ByteBuffer;J)Z

    goto :goto_33

    :cond_1b
    iget-object v3, p0, Lz5/g9;->J:[Lz5/v8;

    aget-object v3, v3, v1

    invoke-interface {v3, v2}, Lz5/v8;->b(Ljava/nio/ByteBuffer;)V

    invoke-interface {v3}, Lz5/v8;->zzg()Ljava/nio/ByteBuffer;

    move-result-object v3

    iget-object v4, p0, Lz5/g9;->K:[Ljava/nio/ByteBuffer;

    aput-object v3, v4, v1

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

    move-result v3

    if-eqz v3, :cond_33

    add-int/lit8 v1, v1, 0x1

    goto :goto_4

    :cond_33
    :goto_33
    invoke-virtual {v2}, Ljava/nio/ByteBuffer;->hasRemaining()Z

    move-result v2

    if-eqz v2, :cond_3a

    return-void

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

    goto :goto_4

    :cond_3d
    return-void
.end method

.method public final i(Ljava/nio/ByteBuffer;J)Z
    .registers 13

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

    move-result p2

    const/4 p3, 0x1

    if-nez p2, :cond_8

    return p3

    :cond_8
    iget-object p2, p0, Lz5/g9;->M:Ljava/nio/ByteBuffer;

    const/16 v0, 0x15

    const/4 v1, 0x0

    if-eqz p2, :cond_18

    if-ne p2, p1, :cond_13

    move p2, p3

    goto :goto_14

    :cond_13
    move p2, v1

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

    goto :goto_3b

    :cond_18
    iput-object p1, p0, Lz5/g9;->M:Ljava/nio/ByteBuffer;

    sget p2, Lz5/be;->a:I

    if-ge p2, v0, :cond_3b

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

    move-result p2

    iget-object v2, p0, Lz5/g9;->N:[B

    if-eqz v2, :cond_29

    array-length v2, v2

    if-ge v2, p2, :cond_2d

    :cond_29
    new-array v2, p2, [B

    iput-object v2, p0, Lz5/g9;->N:[B

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

    move-result v2

    iget-object v3, p0, Lz5/g9;->N:[B

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

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

    iput v1, p0, Lz5/g9;->O:I

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

    move-result p2

    sget v2, Lz5/be;->a:I

    if-ge v2, v0, :cond_76

    iget-wide v2, p0, Lz5/g9;->D:J

    iget-object v0, p0, Lz5/g9;->g:Lz5/a9;

    invoke-virtual {v0}, Lz5/a9;->b()J

    move-result-wide v4

    iget v0, p0, Lz5/g9;->C:I

    iget v6, p0, Lz5/g9;->n:I

    int-to-long v7, v0

    mul-long/2addr v4, v7

    sub-long/2addr v2, v4

    long-to-int v0, v2

    sub-int/2addr v6, v0

    if-lez v6, :cond_74

    invoke-static {p2, v6}, Ljava/lang/Math;->min(II)I

    move-result v0

    iget-object v2, p0, Lz5/g9;->i:Landroid/media/AudioTrack;

    iget-object v3, p0, Lz5/g9;->N:[B

    iget v4, p0, Lz5/g9;->O:I

    invoke-virtual {v2, v3, v4, v0}, Landroid/media/AudioTrack;->write([BII)I

    move-result v0

    if-lez v0, :cond_7c

    iget v2, p0, Lz5/g9;->O:I

    add-int/2addr v2, v0

    iput v2, p0, Lz5/g9;->O:I

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

    move-result v2

    add-int/2addr v2, v0

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

    goto :goto_7c

    :cond_74
    move v0, v1

    goto :goto_7c

    :cond_76
    iget-object v0, p0, Lz5/g9;->i:Landroid/media/AudioTrack;

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

    move-result v0

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

    move-result-wide v2

    iput-wide v2, p0, Lz5/g9;->U:J

    if-ltz v0, :cond_91

    iget-wide v2, p0, Lz5/g9;->D:J

    int-to-long v4, v0

    add-long/2addr v2, v4

    iput-wide v2, p0, Lz5/g9;->D:J

    if-ne v0, p2, :cond_90

    const/4 p1, 0x0

    iput-object p1, p0, Lz5/g9;->M:Ljava/nio/ByteBuffer;

    return p3

    :cond_90
    return v1

    :cond_91
    new-instance p1, Lz5/f9;

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

    throw p1
.end method

.method public final j()Z
    .registers 10

    iget v0, p0, Lz5/g9;->P:I

    const/4 v1, -0x1

    const/4 v2, 0x1

    const/4 v3, 0x0

    if-ne v0, v1, :cond_b

    iput v3, p0, Lz5/g9;->P:I

    :goto_9
    move v0, v2

    goto :goto_c

    :cond_b
    move v0, v3

    :goto_c
    iget v4, p0, Lz5/g9;->P:I

    iget-object v5, p0, Lz5/g9;->J:[Lz5/v8;

    array-length v6, v5

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

    if-ge v4, v6, :cond_2f

    aget-object v4, v5, v4

    if-eqz v0, :cond_1f

    invoke-interface {v4}, Lz5/v8;->zzf()V

    :cond_1f
    invoke-virtual {p0, v7, v8}, Lz5/g9;->h(J)V

    invoke-interface {v4}, Lz5/v8;->zzh()Z

    move-result v0

    if-nez v0, :cond_29

    return v3

    :cond_29
    iget v0, p0, Lz5/g9;->P:I

    add-int/2addr v0, v2

    iput v0, p0, Lz5/g9;->P:I

    goto :goto_9

    :cond_2f
    iget-object v0, p0, Lz5/g9;->M:Ljava/nio/ByteBuffer;

    if-eqz v0, :cond_3b

    invoke-virtual {p0, v0, v7, v8}, Lz5/g9;->i(Ljava/nio/ByteBuffer;J)Z

    iget-object v0, p0, Lz5/g9;->M:Ljava/nio/ByteBuffer;

    if-eqz v0, :cond_3b

    return v3

    :cond_3b
    iput v1, p0, Lz5/g9;->P:I

    return v2
.end method

.method public final k()V
    .registers 3

    invoke-virtual {p0}, Lz5/g9;->l()Z

    move-result v0

    if-nez v0, :cond_7

    return-void

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

    const/16 v1, 0x15

    if-lt v0, v1, :cond_15

    iget-object v0, p0, Lz5/g9;->i:Landroid/media/AudioTrack;

    iget v1, p0, Lz5/g9;->I:F

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

    return-void

    :cond_15
    iget-object v0, p0, Lz5/g9;->i:Landroid/media/AudioTrack;

    iget v1, p0, Lz5/g9;->I:F

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

    return-void
.end method

.method public final l()Z
    .registers 2

    iget-object v0, p0, Lz5/g9;->i: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 m(J)J
    .registers 5

    const-wide/32 v0, 0xf4240

    mul-long/2addr p1, v0

    iget v0, p0, Lz5/g9;->j:I

    int-to-long v0, v0

    div-long/2addr p1, v0

    return-wide p1
.end method

.method public final n(J)J
    .registers 5

    iget v0, p0, Lz5/g9;->j:I

    int-to-long v0, v0

    mul-long/2addr p1, v0

    const-wide/32 v0, 0xf4240

    div-long/2addr p1, v0

    return-wide p1
.end method

.method public final o()J
    .registers 5

    iget-wide v0, p0, Lz5/g9;->D:J

    iget v2, p0, Lz5/g9;->C:I

    int-to-long v2, v2

    div-long/2addr v0, v2

    return-wide v0
.end method

.method public final p()Z
    .registers 5

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

    const/4 v1, 0x1

    const/4 v2, 0x0

    const/16 v3, 0x17

    if-ge v0, v3, :cond_12

    iget v0, p0, Lz5/g9;->m:I

    const/4 v3, 0x5

    if-eq v0, v3, :cond_13

    const/4 v3, 0x6

    if-eq v0, v3, :cond_11

    goto :goto_12

    :cond_11
    return v1

    :cond_12
    :goto_12
    move v1, v2

    :cond_13
    return v1
.end method
