package com.google.android.exoplayer2.source;

import android.os.Handler;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.b;
import com.google.android.exoplayer2.h.i;
import com.google.android.exoplayer2.i.a;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.io.IOException;

public final class a$a {
    public final a bfZ;
    private final long bga;
    public final Handler handler;

    public a$a(Handler handler, a aVar) {
        this(handler, aVar, (byte) 0);
    }

    private a$a(Handler handler, a aVar, byte b) {
        AppMethodBeat.i(95435);
        this.handler = aVar != null ? (Handler) a.checkNotNull(handler) : null;
        this.bfZ = aVar;
        this.bga = 0;
        AppMethodBeat.o(95435);
    }

    public final void a(i iVar, int i, int i2, Format format, int i3, Object obj, long j, long j2, long j3) {
        AppMethodBeat.i(95436);
        if (this.bfZ != null) {
            this.handler.post(new 1(this, iVar, i, i2, format, i3, obj, j, j2, j3));
        }
        AppMethodBeat.o(95436);
    }

    public final void a(i iVar, long j, long j2, long j3) {
        AppMethodBeat.i(95437);
        a(iVar, 4, -1, null, 0, null, -9223372036854775807L, -9223372036854775807L, j, j2, j3);
        AppMethodBeat.o(95437);
    }

    public final void a(i iVar, int i, int i2, Format format, int i3, Object obj, long j, long j2, long j3, long j4, long j5) {
        AppMethodBeat.i(95438);
        if (this.bfZ != null) {
            final i iVar2 = iVar;
            final int i4 = i;
            final int i5 = i2;
            final Format format2 = format;
            final int i6 = i3;
            final Object obj2 = obj;
            final long j6 = j;
            final long j7 = j2;
            final long j8 = j3;
            final long j9 = j4;
            final long j10 = j5;
            this.handler.post(new Runnable() {
                public final void run() {
                    AppMethodBeat.i(95430);
                    a aVar = a$a.this.bfZ;
                    a$a.a(a$a.this, j6);
                    a$a.a(a$a.this, j7);
                    aVar.rO();
                    AppMethodBeat.o(95430);
                }
            });
        }
        AppMethodBeat.o(95438);
    }

    public final void b(i iVar, long j, long j2, long j3) {
        AppMethodBeat.i(95439);
        b(iVar, 4, -1, null, 0, null, -9223372036854775807L, -9223372036854775807L, j, j2, j3);
        AppMethodBeat.o(95439);
    }

    public final void b(i iVar, int i, int i2, Format format, int i3, Object obj, long j, long j2, long j3, long j4, long j5) {
        AppMethodBeat.i(95440);
        if (this.bfZ != null) {
            this.handler.post(new 3(this, iVar, i, i2, format, i3, obj, j, j2, j3, j4, j5));
        }
        AppMethodBeat.o(95440);
    }

    public final void a(i iVar, long j, long j2, long j3, IOException iOException, boolean z) {
        AppMethodBeat.i(95441);
        a(iVar, 4, -1, null, 0, null, -9223372036854775807L, -9223372036854775807L, j, j2, j3, iOException, z);
        AppMethodBeat.o(95441);
    }

    public final void a(i iVar, int i, int i2, Format format, int i3, Object obj, long j, long j2, long j3, long j4, long j5, IOException iOException, boolean z) {
        AppMethodBeat.i(95442);
        if (this.bfZ != null) {
            this.handler.post(new 4(this, iVar, i, i2, format, i3, obj, j, j2, j3, j4, j5, iOException, z));
        }
        AppMethodBeat.o(95442);
    }

    public final void rQ() {
        AppMethodBeat.i(95443);
        this.handler.post(new 6(this));
        AppMethodBeat.o(95443);
    }

    static /* synthetic */ long a(a$a a_a, long j) {
        AppMethodBeat.i(95444);
        long w = b.w(j);
        if (w == -9223372036854775807L) {
            AppMethodBeat.o(95444);
            return -9223372036854775807L;
        }
        long j2 = a_a.bga + w;
        AppMethodBeat.o(95444);
        return j2;
    }
}
