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


# instance fields
.field public final a:Lz5/x2;

.field public final b:I

.field public final c:I

.field public final d:I

.field public final e:I

.field public final f:I

.field public final g:I

.field public final h:[Lz5/ai0;


# direct methods
.method public constructor <init>(Lz5/x2;IIIII[Lz5/ai0;)V
    .registers 12

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

    iput-object p1, p0, Lz5/su0;->a:Lz5/x2;

    iput p2, p0, Lz5/su0;->b:I

    iput p3, p0, Lz5/su0;->c:I

    iput p4, p0, Lz5/su0;->d:I

    iput p5, p0, Lz5/su0;->e:I

    iput p6, p0, Lz5/su0;->f:I

    iput-object p7, p0, Lz5/su0;->h:[Lz5/ai0;

    invoke-static {p4, p5, p6}, Landroid/media/AudioTrack;->getMinBufferSize(III)I

    move-result p1

    const/4 p2, -0x2

    if-eq p1, p2, :cond_1a

    const/4 p2, 0x1

    goto :goto_1b

    :cond_1a
    const/4 p2, 0x0

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

    mul-int/lit8 p2, p1, 0x4

    const-wide/32 p5, 0x3d090

    int-to-long v0, p4

    mul-long/2addr p5, v0

    const-wide/32 v2, 0xf4240

    .line 1
    div-long/2addr p5, v2

    long-to-int p4, p5

    mul-int/2addr p4, p3

    const-wide/32 p5, 0xb71b0

    mul-long/2addr v0, p5

    div-long/2addr v0, v2

    long-to-int p5, v0

    mul-int/2addr p5, p3

    .line 2
    invoke-static {p1, p5}, Ljava/lang/Math;->max(II)I

    move-result p1

    invoke-static {p2, p4, p1}, Lz5/r7;->v(III)I

    move-result p1

    iput p1, p0, Lz5/su0;->g:I

    return-void
.end method


# virtual methods
.method public final a(J)J
    .registers 5

    const-wide/32 v0, 0xf4240

    mul-long/2addr p1, v0

    iget v0, p0, Lz5/su0;->d:I

    int-to-long v0, v0

    div-long/2addr p1, v0

    return-wide p1
.end method

.method public final b(ZLz5/ch1;I)Landroid/media/AudioTrack;
    .registers 14

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

    const/16 v0, 0x1d

    const/4 v1, 0x1

    if-lt p1, v0, :cond_3a

    iget p1, p0, Lz5/su0;->d:I

    iget v0, p0, Lz5/su0;->e:I

    iget v2, p0, Lz5/su0;->f:I

    invoke-static {p1, v0, v2}, Lz5/ky0;->a(III)Landroid/media/AudioFormat;

    move-result-object p1

    invoke-virtual {p2}, Lz5/ch1;->a()Landroid/media/AudioAttributes;

    move-result-object p2

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

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

    invoke-virtual {v0, p2}, Landroid/media/AudioTrack$Builder;->setAudioAttributes(Landroid/media/AudioAttributes;)Landroid/media/AudioTrack$Builder;

    move-result-object p2

    invoke-virtual {p2, p1}, Landroid/media/AudioTrack$Builder;->setAudioFormat(Landroid/media/AudioFormat;)Landroid/media/AudioTrack$Builder;

    move-result-object p1

    invoke-virtual {p1, v1}, Landroid/media/AudioTrack$Builder;->setTransferMode(I)Landroid/media/AudioTrack$Builder;

    move-result-object p1

    iget p2, p0, Lz5/su0;->g:I

    invoke-virtual {p1, p2}, Landroid/media/AudioTrack$Builder;->setBufferSizeInBytes(I)Landroid/media/AudioTrack$Builder;

    move-result-object p1

    invoke-virtual {p1, p3}, Landroid/media/AudioTrack$Builder;->setSessionId(I)Landroid/media/AudioTrack$Builder;

    move-result-object p1

    const/4 p2, 0x0

    invoke-virtual {p1, p2}, Landroid/media/AudioTrack$Builder;->setOffloadedPlayback(Z)Landroid/media/AudioTrack$Builder;

    move-result-object p1

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

    move-result-object p1

    goto :goto_7e

    :cond_3a
    const/16 v0, 0x15

    if-lt p1, v0, :cond_57

    new-instance p1, Landroid/media/AudioTrack;

    invoke-virtual {p2}, Lz5/ch1;->a()Landroid/media/AudioAttributes;

    move-result-object v3

    iget p2, p0, Lz5/su0;->d:I

    iget v0, p0, Lz5/su0;->e:I

    iget v2, p0, Lz5/su0;->f:I

    invoke-static {p2, v0, v2}, Lz5/ky0;->a(III)Landroid/media/AudioFormat;

    move-result-object v4

    iget v5, p0, Lz5/su0;->g:I

    const/4 v6, 0x1

    move-object v2, p1

    move v7, p3

    invoke-direct/range {v2 .. v7}, Landroid/media/AudioTrack;-><init>(Landroid/media/AudioAttributes;Landroid/media/AudioFormat;III)V

    goto :goto_7e

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

    if-nez p3, :cond_6d

    new-instance p1, Landroid/media/AudioTrack;

    const/4 v3, 0x3

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

    iget v5, p0, Lz5/su0;->e:I

    iget v6, p0, Lz5/su0;->f:I

    iget v7, p0, Lz5/su0;->g:I

    const/4 v8, 0x1

    move-object v2, p1

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

    goto :goto_7e

    :cond_6d
    new-instance p1, Landroid/media/AudioTrack;

    const/4 v3, 0x3

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

    iget v5, p0, Lz5/su0;->e:I

    iget v6, p0, Lz5/su0;->f:I

    iget v7, p0, Lz5/su0;->g:I

    const/4 v8, 0x1

    move-object v2, p1

    move v9, p3

    invoke-direct/range {v2 .. v9}, Landroid/media/AudioTrack;-><init>(IIIIIII)V
    :try_end_7e
    .catch Ljava/lang/UnsupportedOperationException; {:try_start_0 .. :try_end_7e} :catch_9b
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_7e} :catch_99

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

    move-result v3

    if-ne v3, v1, :cond_85

    return-object p1

    :cond_85
    :try_start_85
    invoke-virtual {p1}, Landroid/media/AudioTrack;->release()V
    :try_end_88
    .catch Ljava/lang/Exception; {:try_start_85 .. :try_end_88} :catch_88

    :catch_88
    new-instance p1, Lz5/fp0;

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

    iget v5, p0, Lz5/su0;->e:I

    iget v6, p0, Lz5/su0;->g:I

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

    const/4 v8, 0x0

    const/4 v9, 0x0

    move-object v2, p1

    invoke-direct/range {v2 .. v9}, Lz5/fp0;-><init>(IIIILz5/x2;ZLjava/lang/Exception;)V

    throw p1

    :catch_99
    move-exception p1

    goto :goto_9c

    :catch_9b
    move-exception p1

    :goto_9c
    move-object v7, p1

    new-instance p1, Lz5/fp0;

    const/4 v1, 0x0

    iget v2, p0, Lz5/su0;->d:I

    iget v3, p0, Lz5/su0;->e:I

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

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

    const/4 v6, 0x0

    move-object v0, p1

    invoke-direct/range {v0 .. v7}, Lz5/fp0;-><init>(IIIILz5/x2;ZLjava/lang/Exception;)V

    throw p1
.end method
