From c91ab20c3aee4ecd397da910707196076c5ea53b Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 10:50:13 +0100 Subject: [PATCH] --- yaml --- r: 15947 b: refs/heads/master c: a57d15158113cb7f10e662e6df07f445c986a12d h: refs/heads/master i: 15945: 472224d63f4fb904cd16b27e9cb2eb965559527d 15943: 83b43d6767b372cea2cb029cc6549da38fedc9e4 v: v3 --- [refs] | 2 +- trunk/sound/synth/emux/emux.c | 32 +++++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index b78f904e2e75..9bba15db64f1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cb432379eff40d5656ca9f24afc435b4df353d13 +refs/heads/master: a57d15158113cb7f10e662e6df07f445c986a12d diff --git a/trunk/sound/synth/emux/emux.c b/trunk/sound/synth/emux/emux.c index 9e2b4c0c8a8a..2aacd8a884e5 100644 --- a/trunk/sound/synth/emux/emux.c +++ b/trunk/sound/synth/emux/emux.c @@ -66,6 +66,29 @@ int snd_emux_new(snd_emux_t **remu) /* */ +static int sf_sample_new(void *private_data, snd_sf_sample_t *sp, + snd_util_memhdr_t *hdr, + const void __user *buf, long count) +{ + snd_emux_t *emu = private_data; + return emu->ops.sample_new(emu, sp, hdr, buf, count); + +} + +static int sf_sample_free(void *private_data, snd_sf_sample_t *sp, + snd_util_memhdr_t *hdr) +{ + snd_emux_t *emu = private_data; + return emu->ops.sample_free(emu, sp, hdr); + +} + +static void sf_sample_reset(void *private_data) +{ + snd_emux_t *emu = private_data; + emu->ops.sample_reset(emu); +} + int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name) { int err; @@ -85,9 +108,12 @@ int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name) /* create soundfont list */ memset(&sf_cb, 0, sizeof(sf_cb)); sf_cb.private_data = emu; - sf_cb.sample_new = (snd_sf_sample_new_t)emu->ops.sample_new; - sf_cb.sample_free = (snd_sf_sample_free_t)emu->ops.sample_free; - sf_cb.sample_reset = (snd_sf_sample_reset_t)emu->ops.sample_reset; + if (emu->ops.sample_new) + sf_cb.sample_new = sf_sample_new; + if (emu->ops.sample_free) + sf_cb.sample_free = sf_sample_free; + if (emu->ops.sample_reset) + sf_cb.sample_reset = sf_sample_reset; emu->sflist = snd_sf_new(&sf_cb, emu->memhdr); if (emu->sflist == NULL) return -ENOMEM;