audio: expose drv_opaque to init_out and init_in
Currently the opaque pointer returned by audio_driver's init is only
exposed to the driver's fini, but not to audio_pcm_ops. This way if
someone wants to share a variable with the driver and the pcm, he must
use global variables. This patch fixes it by adding a third parameter to
audio_pcm_op's init_out and init_in.
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
diff --git a/audio/wavaudio.c b/audio/wavaudio.c
index 6846a1a..09083da 100644
--- a/audio/wavaudio.c
+++ b/audio/wavaudio.c
@@ -105,7 +105,8 @@
}
}
-static int wav_init_out (HWVoiceOut *hw, struct audsettings *as)
+static int wav_init_out(HWVoiceOut *hw, struct audsettings *as,
+ void *drv_opaque)
{
WAVVoiceOut *wav = (WAVVoiceOut *) hw;
int bits16 = 0, stereo = 0;
@@ -117,8 +118,6 @@
};
struct audsettings wav_as = conf.settings;
- (void) as;
-
stereo = wav_as.nchannels == 2;
switch (wav_as.fmt) {
case AUD_FMT_S8: