package com.tencent.mm.plugin.voip.model;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.audio.b.c.a;

class m$1 implements a {
    final /* synthetic */ m sQb;

    m$1(m mVar) {
        this.sQb = mVar;
    }

    public final void u(byte[] bArr, int i) {
        AppMethodBeat.i(4436);
        synchronized (m.m(this.sQb)) {
            try {
                if (this.sQb.kzf == 2 && m.a(this.sQb) != null) {
                    long currentTimeMillis;
                    if (m.b(this.sQb) == 1) {
                        m.a(this.sQb, System.currentTimeMillis());
                        m.b(this.sQb, m.c(this.sQb));
                        m.d(this.sQb);
                    } else {
                        currentTimeMillis = System.currentTimeMillis();
                        m.a(this.sQb, (int) ((currentTimeMillis - m.e(this.sQb)) - ((long) (m.sPZ * 20))));
                        m.a(this.sQb, currentTimeMillis);
                    }
                    if (m.f(this.sQb) <= 10) {
                        m.b(this.sQb, 92);
                    }
                    m.b(this.sQb, ((m.a(this.sQb).cIq() + 24) + (m.f(this.sQb) * 3)) / 4);
                    if (m.g(this.sQb) == 1) {
                        m.c(this.sQb, m.a(this.sQb).cIn());
                        if (m.h(this.sQb) >= m.f(this.sQb)) {
                            m.c(this.sQb, m.h(this.sQb) - m.f(this.sQb));
                        }
                        m.b(this.sQb, m.h(this.sQb));
                        m.i(this.sQb);
                    } else {
                        m.b(this.sQb, 0);
                    }
                    if (1 == m.j(this.sQb)) {
                        m.k(this.sQb);
                        m.c(this.sQb, System.currentTimeMillis());
                        com.tencent.mm.plugin.voip.a.a.Logi("MicroMsg.Voip.VoipDeviceHandler", "amyfwang,first record");
                    } else {
                        currentTimeMillis = System.currentTimeMillis();
                        long l = currentTimeMillis - m.l(this.sQb);
                        if (l > 1000) {
                            com.tencent.mm.plugin.voip.a.a.Logi("MicroMsg.Voip.VoipDeviceHandler", "amyfwang,error,deltaTime:".concat(String.valueOf(l)));
                        }
                        m.c(this.sQb, currentTimeMillis);
                    }
                    this.sQb.sNl.sPp.recordCallback(bArr, i, m.f(this.sQb));
                    m.sPZ++;
                }
            } finally {
                AppMethodBeat.o(4436);
            }
        }
    }

    public final void bN(int i, int i2) {
    }
}
