From bee86e7dacdc2fffd80618be74c00acb457664c7 Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Sat, 2 Sep 2017 18:41:22 +0900 Subject: libopna: adpcm: fix levelmeter when not playing --- libopna/opnaadpcm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libopna/opnaadpcm.c') diff --git a/libopna/opnaadpcm.c b/libopna/opnaadpcm.c index 361064a..7825c40 100644 --- a/libopna/opnaadpcm.c +++ b/libopna/opnaadpcm.c @@ -182,9 +182,11 @@ void opna_adpcm_writereg(struct opna_adpcm *adpcm, unsigned reg, unsigned val) { } void opna_adpcm_mix(struct opna_adpcm *adpcm, int16_t *buf, unsigned samples) { - if (!adpcm->ram) return; - if (!(adpcm->control1 & C1_START)) return; unsigned level = 0; + if (!adpcm->ram || !(adpcm->control1 & C1_START)) { + leveldata_update(&adpcm->leveldata, level); + return; + } for (unsigned i = 0; i < samples; i++) { adpcm_calc(adpcm); { -- cgit v1.2.3