package com.tencent.mm.plugin.music.b.a;

import android.text.TextUtils;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.music.b.a.c.a;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ag;

class c$3 implements Runnable {
    final /* synthetic */ long hTt;
    final /* synthetic */ String oJX;
    final /* synthetic */ String oKE;
    final /* synthetic */ c oKF;
    final /* synthetic */ boolean oKG;
    final /* synthetic */ long oKH;
    final /* synthetic */ long oKI;
    final /* synthetic */ long oKJ;
    final /* synthetic */ String oKK;
    final /* synthetic */ long oKL;
    final /* synthetic */ long oKM;

    c$3(c cVar, String str, String str2, long j, long j2, long j3, boolean z, String str3, long j4, long j5, long j6) {
        this.oKF = cVar;
        this.oJX = str;
        this.oKE = str2;
        this.oKH = j;
        this.oKI = j2;
        this.oKJ = j3;
        this.oKG = z;
        this.oKK = str3;
        this.oKL = j4;
        this.oKM = j5;
        this.hTt = j6;
    }

    public final void run() {
        AppMethodBeat.i(104818);
        String str = this.oJX + "-" + ag.ck(this.oKE);
        synchronized (c.bDq()) {
            try {
                int intValue;
                if (c.bDq().containsKey(str)) {
                    c.a(c.bTo(), str, this.oKH);
                    c.a(c.bTp(), str, this.oKI);
                    c.a(c.bTq(), str, this.oKJ);
                    intValue = ((Integer) c.bDq().get(str)).intValue() - 1;
                    if (intValue > 0) {
                        c.bDq().put(str, Integer.valueOf(intValue));
                    } else {
                        c.bDq().remove(str);
                    }
                    if (this.oKG) {
                        c.bTs();
                    } else {
                        c.zt(1);
                        c.bTr();
                    }
                } else {
                    ab.d("MicroMsg.Audio.AudioReportService", "leonlaudio not exist audioKey, audioId:%s, audioSrc:%s", new Object[]{this.oJX, this.oKE});
                }
                if (c.Nx().containsKey(str)) {
                    intValue = ((Integer) c.Nx().get(str)).intValue() - 1;
                    if (intValue > 0) {
                        c.Nx().put(str, Integer.valueOf(intValue));
                    } else {
                        c.Nx().remove(str);
                    }
                }
                if (!(this.oKG || TextUtils.isEmpty(this.oKK))) {
                    a aVar;
                    if (c.bTt().containsKey(this.oKK)) {
                        aVar = (a) c.bTt().get(this.oKK);
                        if (aVar != null) {
                            aVar.playCount++;
                        }
                        aVar.oKQ = this.oKL;
                        aVar.fileSize = this.oKM;
                        aVar.duration = this.hTt;
                        c.bTt().put(this.oKK, aVar);
                    } else {
                        aVar = new a(this.oKF);
                        aVar.playCount = 1;
                        aVar.oKQ = this.oKL;
                        aVar.fileSize = this.oKM;
                        aVar.duration = this.hTt;
                        c.bTt().put(this.oKK, aVar);
                    }
                }
            } finally {
                AppMethodBeat.o(104818);
            }
        }
    }
}
