diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-07-17 15:43:15 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-07-17 15:43:15 +0100 |
commit | 63dba7e6b18aa85392800f0cb7c897e3a05b097b (patch) | |
tree | 45c1847e5c028be86947b38fe42c37dc3d8aa4d9 /hw/audio/fmopl.c | |
parent | 1f244ebbba650b82828b6139377d6199fe648d6b (diff) | |
parent | 639b49ef9a4dc9555ed6aaefa8dfda621e4165cf (diff) |
Merge remote-tracking branch 'remotes/kraxel/tags/audio-20170717-pull-request' into staging
audio: fixes for 2.10
# gpg: Signature made Mon 17 Jul 2017 10:29:08 BST
# gpg: using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg: aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138
* remotes/kraxel/tags/audio-20170717-pull-request:
audio/adlib: remove limitation of one adlib card
audio/fmopl: modify timer callback to give opaque and channel parameters in two arguments
audio: st_rate_flow exist a infinite loop
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/audio/fmopl.c')
-rw-r--r-- | hw/audio/fmopl.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c index 202f752c5d..5cfb6a96dd 100644 --- a/hw/audio/fmopl.c +++ b/hw/audio/fmopl.c @@ -788,14 +788,18 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v) { double interval = st2 ? (double)OPL->T[1]*OPL->TimerBase : 0.0; OPL->st[1] = st2; - if (OPL->TimerHandler) (OPL->TimerHandler)(OPL->TimerParam+1,interval); + if (OPL->TimerHandler) { + (OPL->TimerHandler)(OPL->TimerParam, 1, interval); + } } /* timer 1 */ if(OPL->st[0] != st1) { double interval = st1 ? (double)OPL->T[0]*OPL->TimerBase : 0.0; OPL->st[0] = st1; - if (OPL->TimerHandler) (OPL->TimerHandler)(OPL->TimerParam+0,interval); + if (OPL->TimerHandler) { + (OPL->TimerHandler)(OPL->TimerParam, 0, interval); + } } } return; @@ -1128,10 +1132,11 @@ void OPLDestroy(FM_OPL *OPL) /* ---------- Option handlers ---------- */ -void OPLSetTimerHandler(FM_OPL *OPL,OPL_TIMERHANDLER TimerHandler,int channelOffset) +void OPLSetTimerHandler(FM_OPL *OPL, OPL_TIMERHANDLER TimerHandler, + void *param) { OPL->TimerHandler = TimerHandler; - OPL->TimerParam = channelOffset; + OPL->TimerParam = param; } /* ---------- YM3812 I/O interface ---------- */ @@ -1197,6 +1202,9 @@ int OPLTimerOver(FM_OPL *OPL,int c) } } /* reload timer */ - if (OPL->TimerHandler) (OPL->TimerHandler)(OPL->TimerParam+c,(double)OPL->T[c]*OPL->TimerBase); + if (OPL->TimerHandler) { + (OPL->TimerHandler)(OPL->TimerParam, c, + (double)OPL->T[c] * OPL->TimerBase); + } return OPL->status>>7; } |