package com.tencent.mm.modelvideo;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.m;
import com.tencent.mm.compatible.util.g;
import com.tencent.mm.modelvideo.y.a;
import com.tencent.mm.sdk.platformtools.ab;

class y$a$2 implements Runnable {
    final /* synthetic */ m crb;
    final /* synthetic */ int crc;
    final /* synthetic */ int crd;
    final /* synthetic */ a fXQ;

    y$a$2(a aVar, m mVar, int i, int i2) {
        this.fXQ = aVar;
        this.crb = mVar;
        this.crc = i;
        this.crd = i2;
    }

    public final void run() {
        int i;
        Object obj;
        AppMethodBeat.i(50868);
        a.acr();
        String str;
        if (this.crb.getType() == 150) {
            a.b(this.fXQ);
            str = ((d) this.crb).fileName;
            y.fXG = str;
            int i2 = ((d) this.crb).retCode;
            a.c(this.fXQ);
            i = i2;
            obj = str;
        } else if (this.crb.getType() == 149) {
            a.d(this.fXQ);
            a.e(this.fXQ);
            String obj2;
            if (this.crb instanceof g) {
                str = ((g) this.crb).fileName;
                i = ((g) this.crb).retCode;
                obj2 = str;
            } else if (this.crb instanceof h) {
                i = 0;
                obj2 = ((h) this.crb).fileName;
            } else {
                i = 0;
                obj2 = null;
            }
        } else {
            ab.e("MicroMsg.VideoService", "onSceneEnd Error SceneType:" + this.crb.getType());
            a.alI();
            AppMethodBeat.o(50868);
            return;
        }
        long j = 0;
        if (!(obj2 == null || this.fXQ.cqS.get(obj2) == null)) {
            j = ((g.a) this.fXQ.cqS.get(obj2)).Mr();
            this.fXQ.cqS.remove(obj2);
        }
        ab.d("MicroMsg.VideoService", "onSceneEnd SceneType:" + this.crb.getType() + " errtype:" + this.crc + " errCode:" + this.crd + " retCode:" + i + " file:" + obj2 + " time:" + j);
        if (this.crc == 3 && i != 0) {
            a.f(this.fXQ);
        } else if (this.crc != 0) {
            a.a(this.fXQ, 0);
        }
        ab.d("MicroMsg.VideoService", "onSceneEnd  inCnt:" + a.access$100() + " stop:" + a.g(this.fXQ) + " running:" + a.h(this.fXQ) + " recving:" + a.i(this.fXQ) + " sending:" + a.j(this.fXQ));
        if (a.g(this.fXQ) > 0) {
            a.a(this.fXQ);
        } else if (!(a.j(this.fXQ) || a.i(this.fXQ))) {
            a.k(this.fXQ);
        }
        a.alI();
        AppMethodBeat.o(50868);
    }

    public final String toString() {
        AppMethodBeat.i(50869);
        String str = super.toString() + "|onSceneEnd";
        AppMethodBeat.o(50869);
        return str;
    }
}
