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


# instance fields
.field public A:J

.field public B:Z

.field public C:J

.field public D:J

.field public final a:Lz5/zw0;

.field public final b:[J

.field public c:Landroid/media/AudioTrack;

.field public d:I

.field public e:I

.field public f:Lz5/or0;

.field public g:I

.field public h:J

.field public i:F

.field public j:Z

.field public k:J

.field public l:J

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

.field public n:J

.field public o:Z

.field public p:Z

.field public q:J

.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:J

.field public y:J

.field public z:J


# direct methods
.method public constructor <init>(Lz5/zw0;)V
    .registers 4

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

    iput-object p1, p0, Lz5/ls0;->a:Lz5/zw0;

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

    const/16 v0, 0x12

    if-lt p1, v0, :cond_16

    :try_start_b
    const-class p1, Landroid/media/AudioTrack;

    const-string v0, "getLatency"

    const/4 v1, 0x0

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

    move-result-object p1

    iput-object p1, p0, Lz5/ls0;->m:Ljava/lang/reflect/Method;
    :try_end_16
    .catch Ljava/lang/NoSuchMethodException; {:try_start_b .. :try_end_16} :catch_16

    :catch_16
    :cond_16
    const/16 p1, 0xa

    new-array p1, p1, [J

    iput-object p1, p0, Lz5/ls0;->b:[J

    return-void
.end method


# virtual methods
.method public final a(Landroid/media/AudioTrack;ZIII)V
    .registers 6

    iput-object p1, p0, Lz5/ls0;->c:Landroid/media/AudioTrack;

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

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

    new-instance p2, Lz5/or0;

    invoke-direct {p2, p1}, Lz5/or0;-><init>(Landroid/media/AudioTrack;)V

    iput-object p2, p0, Lz5/ls0;->f:Lz5/or0;

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

    move-result p1

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

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

    move-result p1

    iput-boolean p1, p0, Lz5/ls0;->p:Z

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

    if-eqz p1, :cond_27

    div-int/2addr p5, p4

    int-to-long p4, p5

    invoke-virtual {p0, p4, p5}, Lz5/ls0;->b(J)J

    move-result-wide p4

    goto :goto_28

    :cond_27
    move-wide p4, p2

    :goto_28
    iput-wide p4, p0, Lz5/ls0;->h:J

    const-wide/16 p4, 0x0

    iput-wide p4, p0, Lz5/ls0;->r:J

    iput-wide p4, p0, Lz5/ls0;->s:J

    const/4 p1, 0x0

    iput-boolean p1, p0, Lz5/ls0;->o:Z

    iput-wide p2, p0, Lz5/ls0;->v:J

    iput-wide p2, p0, Lz5/ls0;->w:J

    iput-wide p4, p0, Lz5/ls0;->q:J

    iput-wide p4, p0, Lz5/ls0;->n:J

    const/high16 p1, 0x3f800000    # 1.0f

    iput p1, p0, Lz5/ls0;->i:F

    return-void
.end method

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

    const-wide/32 v0, 0xf4240

    mul-long/2addr p1, v0

    iget v0, p0, Lz5/ls0;->g:I

    int-to-long v0, v0

    div-long/2addr p1, v0

    return-wide p1
.end method

.method public final c()J
    .registers 12

    iget-object v0, p0, Lz5/ls0;->c:Landroid/media/AudioTrack;

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

    iget-wide v1, p0, Lz5/ls0;->v:J

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

    cmp-long v1, v1, v3

    if-eqz v1, :cond_2c

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

    move-result-wide v0

    iget-wide v2, p0, Lz5/ls0;->v:J

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

    iget-wide v5, p0, Lz5/ls0;->y:J

    iget-wide v7, p0, Lz5/ls0;->x:J

    const-wide/16 v9, 0x3e8

    mul-long/2addr v0, v9

    sub-long/2addr v0, v2

    int-to-long v2, v4

    mul-long/2addr v0, v2

    const-wide/32 v2, 0xf4240

    div-long/2addr v0, v2

    add-long/2addr v0, v7

    invoke-static {v5, v6, v0, v1}, Ljava/lang/Math;->min(JJ)J

    move-result-wide v0

    return-wide v0

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

    move-result v1

    const/4 v2, 0x1

    const-wide/16 v5, 0x0

    if-ne v1, v2, :cond_36

    return-wide v5

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

    move-result v0

    int-to-long v7, v0

    const-wide v9, 0xffffffffL

    and-long/2addr v7, v9

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

    const/16 v2, 0x1d

    if-gt v0, v2, :cond_65

    cmp-long v0, v7, v5

    if-nez v0, :cond_63

    iget-wide v9, p0, Lz5/ls0;->r:J

    cmp-long v0, v9, v5

    if-lez v0, :cond_63

    const/4 v0, 0x3

    if-ne v1, v0, :cond_63

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

    cmp-long v0, v0, v3

    if-nez v0, :cond_60

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

    move-result-wide v0

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

    :cond_60
    iget-wide v0, p0, Lz5/ls0;->r:J

    return-wide v0

    :cond_63
    iput-wide v3, p0, Lz5/ls0;->w:J

    :cond_65
    iget-wide v0, p0, Lz5/ls0;->r:J

    cmp-long v0, v0, v7

    if-lez v0, :cond_72

    iget-wide v0, p0, Lz5/ls0;->s:J

    const-wide/16 v2, 0x1

    add-long/2addr v0, v2

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

    :cond_72
    iput-wide v7, p0, Lz5/ls0;->r:J

    iget-wide v0, p0, Lz5/ls0;->s:J

    const/16 v2, 0x20

    shl-long/2addr v0, v2

    add-long/2addr v7, v0

    return-wide v7
.end method
