X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=oss_mix.c;h=7fbdba5b770923988e646b96e74582f8ff4e8a1f;hp=b67564773af1157c91fccf3b70d3292d9bdd6cee;hb=e79198e9851faddfd64e47654b5bc66fbc574255;hpb=db2cd7b5404f5f01d25b72beacb3e5245b1bb94c diff --git a/oss_mix.c b/oss_mix.c index b6756477..7fbdba5b 100644 --- a/oss_mix.c +++ b/oss_mix.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2012 Andre Noll + * Copyright (C) 1998 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -56,8 +56,10 @@ static int oss_mix_open(const char *dev, struct mixer_handle **handle) dev = "/dev/mixer"; PARA_INFO_LOG("opening %s\n", dev); ret = para_open(dev, O_RDWR, 42); - if (ret < 0) + if (ret < 0) { + PARA_ERROR_LOG("could not open %s\n", dev); return ret; + } h = para_malloc(sizeof(*h)); h->fd = ret; *handle = h; @@ -96,7 +98,7 @@ static int oss_mix_set_channel(struct mixer_handle *handle, handle->id = i; return 1; } - return -E_OSS_MIXER_CHANNEL; + return -E_BAD_CHANNEL; } static int oss_mix_get(struct mixer_handle *handle) @@ -133,19 +135,13 @@ static void oss_mix_close(struct mixer_handle **handle) *handle = NULL; } -/** - * The init function of the OSS mixer. - * - * \param self The structure to initialize. - * - * \sa struct \ref mixer, \ref alsa_mix_init(). - */ -void oss_mix_init(struct mixer *self) -{ - self->open = oss_mix_open; - self->get_channels = oss_mix_get_channels; - self->set_channel = oss_mix_set_channel; - self->get = oss_mix_get; - self->set = oss_mix_set; - self->close = oss_mix_close; -} +/** The mixer operations for the OSS mixer. */ +const struct mixer oss_mixer = { + .name = "oss", + .open = oss_mix_open, + .get_channels = oss_mix_get_channels, + .set_channel = oss_mix_set_channel, + .close = oss_mix_close, + .get = oss_mix_get, + .set = oss_mix_set +};