aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/oss_plugin.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-25 17:37:55 +0100
committerMax Kellermann <max@duempel.org>2009-01-25 17:37:55 +0100
commit763dd8c1dd4de451663474bafd13068eb6017bbb (patch)
tree04d25b3107b170987ba6b2b1340f313a760c2e05 /src/output/oss_plugin.c
parentad8561bfdc76d05812efc7fa802df48c37fcf770 (diff)
downloadmpd-763dd8c1dd4de451663474bafd13068eb6017bbb.tar.gz
mpd-763dd8c1dd4de451663474bafd13068eb6017bbb.tar.xz
mpd-763dd8c1dd4de451663474bafd13068eb6017bbb.zip
mixer: return a mixer struct pointer
Don't use statically allocated mixer objects.
Diffstat (limited to 'src/output/oss_plugin.c')
-rw-r--r--src/output/oss_plugin.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/output/oss_plugin.c b/src/output/oss_plugin.c
index b80024b29..0107dbdd2 100644
--- a/src/output/oss_plugin.c
+++ b/src/output/oss_plugin.c
@@ -55,7 +55,9 @@ typedef struct _OssData {
int numSupported[3];
int *unsupported[3];
int numUnsupported[3];
- struct mixer mixer;
+
+ /** the mixer object associated with this output */
+ struct mixer *mixer;
} OssData;
enum oss_support {
@@ -276,7 +278,7 @@ static OssData *newOssData(void)
supportParam(ret, SNDCTL_DSP_CHANNELS, 2);
supportParam(ret, SNDCTL_DSP_SAMPLESIZE, 16);
- mixer_init( &ret->mixer, &oss_mixer);
+ ret->mixer = mixer_new(&oss_mixer);
return ret;
}
@@ -290,7 +292,7 @@ static void freeOssData(OssData * od)
g_free(od->unsupported[OSS_CHANNELS]);
g_free(od->unsupported[OSS_BITS]);
- mixer_finish(&od->mixer);
+ mixer_free(od->mixer);
free(od);
}
@@ -355,7 +357,7 @@ static void *oss_open_default(const struct config_param *param)
if (ret[i] == 0) {
OssData *od = newOssData();
od->device = default_devices[i];
- mixer_configure(&od->mixer, param);
+ mixer_configure(od->mixer, param);
return od;
}
}
@@ -396,7 +398,7 @@ oss_initDriver(G_GNUC_UNUSED struct audio_output *audioOutput,
if (device != NULL) {
OssData *od = newOssData();
od->device = device;
- mixer_configure(&od->mixer, param);
+ mixer_configure(od->mixer, param);
return od;
}
@@ -522,7 +524,7 @@ oss_openDevice(void *data, struct audio_format *audioFormat)
od->audio_format.bits, od->audio_format.channels,
od->audio_format.sample_rate);
- mixer_open(&od->mixer);
+ mixer_open(od->mixer);
return ret;
}
@@ -532,7 +534,7 @@ static void oss_closeDevice(void *data)
OssData *od = data;
oss_close(od);
- mixer_close(&od->mixer);
+ mixer_close(od->mixer);
}
static void oss_dropBufferedAudio(void *data)
@@ -575,7 +577,7 @@ static bool
oss_control(void *data, int cmd, void *arg)
{
OssData *od = data;
- return mixer_control(&od->mixer, cmd, arg);
+ return mixer_control(od->mixer, cmd, arg);
}
const struct audio_output_plugin ossPlugin = {