aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-plug-vol.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/alsa/alsa-plug-vol.c')
-rw-r--r--plugins/alsa/alsa-plug-vol.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/plugins/alsa/alsa-plug-vol.c b/plugins/alsa/alsa-plug-vol.c
index ce4627a..67400a5 100644
--- a/plugins/alsa/alsa-plug-vol.c
+++ b/plugins/alsa/alsa-plug-vol.c
@@ -22,16 +22,27 @@
ALSA_PLUG_PROTO(softvol); // stream uses softvol plugin
+PUBLIC void AlsaDeleteSoftvol(SoftMixerT *mixer, AlsaPcmCtlT * ctl) {
+
+}
+
PUBLIC AlsaPcmCtlT *AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *stream, char* slaveid, AlsaSndCtlT *sndcard, char* ctlName, int max, int open) {
snd_config_t *streamConfig, *elemConfig, *slaveConfig, *controlConfig,*pcmConfig;
- AlsaPcmCtlT *pcmVol= calloc(1,sizeof(AlsaPcmCtlT));
+ char *cardid = NULL;
int error = 0;
-
- AFB_ApiInfo(mixer->api, "%s create SOFTVOL on %s", __func__, slaveid);
+ AlsaPcmCtlT *pcmVol = NULL;
- char *cardid = NULL;
- if (asprintf(&cardid, "softvol-%s", stream->uid) == -1)
+ AFB_ApiDebug(mixer->api, "%s create SOFTVOL on %s", __func__, slaveid);
+ if (asprintf(&cardid, "softvol-%s", stream->uid) == -1) {
+ SOFTMIXER_NOMEM(mixer->api);
goto OnErrorExit;
+ }
+
+ pcmVol = AlsaPcmCtlNew(mixer, cardid);
+ if (pcmVol == NULL) {
+ SOFTMIXER_NOMEM(mixer->api);
+ goto OnErrorExit;
+ }
pcmVol->cid.cardid = (const char *) cardid;
@@ -82,6 +93,8 @@ PUBLIC AlsaPcmCtlT *AlsaCreateSoftvol(SoftMixerT *mixer, AlsaStreamAudioT *strea
goto OnErrorExit;
}
+ stream->softvolConfig = streamConfig;
+
// Debug config & pcm
//AlsaDumpCtlConfig (mixer, "plug-config", pcmConfig, 1);
AlsaDumpCtlConfig(mixer, "plug-softvol", streamConfig, 1);