diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2017-09-02 18:41:22 +0900 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2017-09-02 18:41:22 +0900 |
commit | bee86e7dacdc2fffd80618be74c00acb457664c7 (patch) | |
tree | fd4ceea6985132d1b928f5f6e467e791d20bf245 /libopna/opnaadpcm.c | |
parent | 81f406e25f46affd2e740de4cbbd8d72529a8168 (diff) |
libopna: adpcm: fix levelmeter when not playing
Diffstat (limited to 'libopna/opnaadpcm.c')
-rw-r--r-- | libopna/opnaadpcm.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); { |