summaryrefslogtreecommitdiff
path: root/sound/synth/emux
diff options
context:
space:
mode:
Diffstat (limited to 'sound/synth/emux')
-rw-r--r--sound/synth/emux/emux_hwdep.c5
-rw-r--r--sound/synth/emux/soundfont.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/sound/synth/emux/emux_hwdep.c b/sound/synth/emux/emux_hwdep.c
index d9fcae071b47..fae48d108b97 100644
--- a/sound/synth/emux/emux_hwdep.c
+++ b/sound/synth/emux/emux_hwdep.c
@@ -39,6 +39,11 @@ snd_emux_hwdep_load_patch(struct snd_emux *emu, void __user *arg)
if (copy_from_user(&patch, arg, sizeof(patch)))
return -EFAULT;
+ if (patch.key == GUS_PATCH)
+ return snd_soundfont_load_guspatch(emu->sflist, arg,
+ patch.len + sizeof(patch),
+ TMP_CLIENT_ID);
+
if (patch.type >= SNDRV_SFNT_LOAD_INFO &&
patch.type <= SNDRV_SFNT_PROBE_DATA) {
err = snd_soundfont_load(emu->sflist, arg, patch.len + sizeof(patch), TMP_CLIENT_ID);
diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
index 31a4ea94830e..9b5d70104489 100644
--- a/sound/synth/emux/soundfont.c
+++ b/sound/synth/emux/soundfont.c
@@ -856,6 +856,8 @@ calc_gus_envelope_time(int rate, int start, int end)
int r, p, t;
r = (3 - ((rate >> 6) & 3)) * 3;
p = rate & 0x3f;
+ if (!p)
+ p = 1;
t = end - start;
if (t < 0) t = -t;
if (13 > r)