summaryrefslogtreecommitdiff
path: root/src/audio_out
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio_out')
-rw-r--r--src/audio_out/Makefile.am102
-rw-r--r--src/audio_out/audio_alsa_out.c34
-rw-r--r--src/audio_out/audio_arts_out.c416
-rw-r--r--src/audio_out/audio_coreaudio_out.c30
-rw-r--r--src/audio_out/audio_directx2_out.c29
-rw-r--r--src/audio_out/audio_directx_out.c26
-rw-r--r--src/audio_out/audio_esd_out.c32
-rw-r--r--src/audio_out/audio_file_out.c32
-rw-r--r--src/audio_out/audio_fusionsound_out.c71
-rw-r--r--src/audio_out/audio_irixal_out.c8
-rw-r--r--src/audio_out/audio_jack_out.c52
-rw-r--r--src/audio_out/audio_none_out.c30
-rw-r--r--src/audio_out/audio_oss_out.c46
-rw-r--r--src/audio_out/audio_pulse_out.c20
-rw-r--r--src/audio_out/audio_sndio_out.c22
-rw-r--r--src/audio_out/audio_sun_out.c34
16 files changed, 195 insertions, 789 deletions
diff --git a/src/audio_out/Makefile.am b/src/audio_out/Makefile.am
index 750d03915..3d35504e9 100644
--- a/src/audio_out/Makefile.am
+++ b/src/audio_out/Makefile.am
@@ -1,143 +1,127 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
-AM_CPPFLAGS = -DXINE_COMPILE
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
AM_LDFLAGS = $(xineplug_ldflags)
+##
+# IMPORTANT:
+# ---------
+# all xine audio out plugins should be named like the
+# scheme "xineplug_ao_out_"
+#
+
EXTRA_DIST = audio_irixal_out.c
-if HAVE_OSS
+if ENABLE_OSS
oss_module = xineplug_ao_out_oss.la
endif
-if HAVE_ALSA
+if ENABLE_ALSA
alsa_module = xineplug_ao_out_alsa.la
endif
-if HAVE_ESD
+if ENABLE_ESD
esd_module = xineplug_ao_out_esd.la
endif
-if HAVE_SUNAUDIO
+if ENABLE_SUNAUDIO
sun_module = xineplug_ao_out_sun.la
endif
-#if HAVE_IRIXAL
+#if ENABLE_IRIXAL
#irixal_module = xineplug_ao_out_irixal.la
#endif
-if HAVE_ARTS
-arts_module = xineplug_ao_out_arts.la
-endif
-
-if HAVE_DIRECTX
+if ENABLE_DIRECTX
directx_module = xineplug_ao_out_directx.la
directx2_module = xineplug_ao_out_directx2.la
endif
-if HAVE_COREAUDIO
+if ENABLE_COREAUDIO
coreaudio_module = xineplug_ao_out_coreaudio.la
endif
-if HAVE_PULSEAUDIO
+if ENABLE_PULSEAUDIO
pulseaudio_module = xineplug_ao_out_pulseaudio.la
endif
-if HAVE_FUSIONSOUND
+if ENABLE_FUSIONSOUND
fusionsound_module = xineplug_ao_out_fusionsound.la
endif
-if HAVE_JACK
+if ENABLE_JACK
jack_module = xineplug_ao_out_jack.la
endif
-if HAVE_SNDIO
+if ENABLE_SNDIO
sndio_module = xineplug_ao_out_sndio.la
endif
-##
-# IMPORTANT:
-# ---------
-# all xine audio out plugins should be named like the
-# scheme "xineplug_ao_out_"
-#
-xineplug_LTLIBRARIES = xineplug_ao_out_none.la xineplug_ao_out_file.la \
- $(oss_module) \
- $(alsa_module) \
- $(sun_module) \
- $(arts_module) \
- $(esd_module) \
- $(directx_module) \
- $(coreaudio_module) \
- $(pulseaudio_module) \
+xineplug_LTLIBRARIES = \
+ xineplug_ao_out_none.la \
+ xineplug_ao_out_file.la \
+ $(oss_module) \
+ $(alsa_module) \
+ $(sun_module) \
+ $(esd_module) \
+ $(directx_module) \
+ $(coreaudio_module) \
+ $(pulseaudio_module) \
$(directx2_module) \
- $(fusionsound_module) \
- $(jack_module) \
+ $(fusionsound_module) \
+ $(jack_module) \
$(sndio_module)
xineplug_ao_out_none_la_SOURCES = audio_none_out.c
xineplug_ao_out_none_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_ao_out_none_la_CFLAGS = $(VISIBILITY_FLAG)
xineplug_ao_out_file_la_SOURCES = audio_file_out.c
xineplug_ao_out_file_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_ao_out_file_la_CFLAGS = $(VISIBILITY_FLAG)
xineplug_ao_out_oss_la_SOURCES = audio_oss_out.c
xineplug_ao_out_oss_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-xineplug_ao_out_oss_la_CFLAGS = $(VISIBILITY_FLAG)
xineplug_ao_out_alsa_la_SOURCES = audio_alsa_out.c
xineplug_ao_out_alsa_la_LIBADD = $(XINE_LIB) $(ALSA_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_ao_out_alsa_la_CFLAGS = $(VISIBILITY_FLAG) $(ALSA_CFLAGS)
+xineplug_ao_out_alsa_la_CFLAGS = $(AM_CFLAGS) $(ALSA_CFLAGS)
xineplug_ao_out_esd_la_SOURCES = audio_esd_out.c
xineplug_ao_out_esd_la_LIBADD = $(XINE_LIB) $(ESD_LIBS) $(LTLIBINTL)
-xineplug_ao_out_esd_la_CFLAGS = $(VISIBILITY_FLAG) $(ESD_CFLAGS)
+xineplug_ao_out_esd_la_CFLAGS = $(AM_CFLAGS) $(ESD_CFLAGS)
xineplug_ao_out_sun_la_SOURCES = audio_sun_out.c
xineplug_ao_out_sun_la_LIBADD = $(XINE_LIB)
-xineplug_ao_out_sun_la_CFLAGS = $(VISIBILITY_FLAG)
#xineplug_ao_out_irixal_la_SOURCES = audio_irixal_out.c
#xineplug_ao_out_irixal_la_LIBADD = $(IRIXAL_LIBS)
-#xineplug_ao_out_irixal_la_CFLAGS = $(VISIBILITY_FLAG) $(IRIXAL_CFLAGS)
-
-xineplug_ao_out_arts_la_SOURCES = audio_arts_out.c
-xineplug_ao_out_arts_la_LIBADD = $(XINE_LIB) $(ARTS_LIBS)
-xineplug_ao_out_arts_la_CFLAGS = $(VISIBILITY_FLAG) $(ARTS_CFLAGS)
+#xineplug_ao_out_irixal_la_CFLAGS = $(AM_CFLAGS) $(IRIXAL_CFLAGS)
xineplug_ao_out_directx_la_SOURCES = audio_directx_out.c
-xineplug_ao_out_directx_la_CPPFLAGS = $(DIRECTX_CPPFLAGS)
xineplug_ao_out_directx_la_LIBADD = $(XINE_LIB) $(DIRECTX_AUDIO_LIBS) $(LTLIBINTL)
-xineplug_ao_out_directx_la_CFLAGS = $(VISIBILITY_FLAG)
+xineplug_ao_out_directx_la_CPPFLAGS = $(AM_CPPFLAGS) $(DIRECTX_CPPFLAGS)
xineplug_ao_out_coreaudio_la_SOURCES = audio_coreaudio_out.c
xineplug_ao_out_coreaudio_la_LIBADD = $(XINE_LIB)
-# The "-Wl,-framework -Wl,..." is needed for libtool versions before
-# 1.5.x (1.257): the default version that ships with Mac OS X is 1.5 (1.1220)
-xineplug_ao_out_coreaudio_la_LDFLAGS = $(AM_LDFLAGS) \
- -Wl,-framework -Wl,Cocoa -framework CoreAudio \
- -Wl,-framework -Wl,AudioUnit -framework AudioUnit \
-xineplug_ao_out_coreaudio_la_CFLAGS = -framework CoreAudio -framework AudioUnit $(VISIBILITY_FLAG)
+xineplug_ao_out_coreaudio_la_LDFLAGS = $(AM_LDFLAGS) -framework CoreAudio -framework AudioUnit
xineplug_ao_out_pulseaudio_la_SOURCES = audio_pulse_out.c
xineplug_ao_out_pulseaudio_la_LIBADD = $(XINE_LIB) $(PULSEAUDIO_LIBS) $(LTLIBINTL)
-xineplug_ao_out_pulseaudio_la_CFLAGS = $(VISIBILITY_FLAG) $(PULSEAUDIO_CFLAGS)
+xineplug_ao_out_pulseaudio_la_CFLAGS = $(AM_CFLAGS) $(PULSEAUDIO_CFLAGS)
xineplug_ao_out_directx2_la_SOURCES = audio_directx2_out.c
-xineplug_ao_out_directx2_la_CPPFLAGS = $(DIRECTX_CPPFLAGS)
-xineplug_ao_out_directx2_la_LIBADD = $(XINE_LIB) $(DIRECTX_AUDIO_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_ao_out_directx2_la_CFLAGS = $(VISIBILITY_FLAG)
+xineplug_ao_out_directx2_la_CPPFLAGS = $(AM_CPPFLAGS) $(DIRECTX_CPPFLAGS) $(LTLIBINTL)
+xineplug_ao_out_directx2_la_LIBADD = $(XINE_LIB) $(DIRECTX_AUDIO_LIBS) $(PTHREAD_LIBS)
xineplug_ao_out_fusionsound_la_SOURCES = audio_fusionsound_out.c
xineplug_ao_out_fusionsound_la_LIBADD = $(XINE_LIB) $(FUSIONSOUND_LIBS)
-xineplug_ao_out_fusionsound_la_CFLAGS = $(VISIBILITY_FLAG) $(FUSIONSOUND_CFLAGS)
+xineplug_ao_out_fusionsound_la_CFLAGS = $(AM_CFLAGS) $(FUSIONSOUND_CFLAGS)
xineplug_ao_out_jack_la_SOURCES = audio_jack_out.c
xineplug_ao_out_jack_la_LIBADD = $(XINE_LIB) $(JACK_LIBS) $(LTLIBINTL)
-xineplug_ao_out_jack_la_CFLAGS = $(VISIBILITY_FLAG) $(JACK_CFLAGS)
+xineplug_ao_out_jack_la_CFLAGS = $(AM_FLAGS) $(JACK_CFLAGS)
xineplug_ao_out_sndio_la_SOURCES = audio_sndio_out.c
xineplug_ao_out_sndio_la_LIBADD = $(XINE_LIB) $(SNDIO_LIBS)
-xineplug_ao_out_sndio_la_CFLAGS = $(VISIBILITY_FLAG) $(SNDIO_CFLAGS)
+xineplug_ao_out_sndio_la_CFLAGS = $(AM_CFLAGS) $(SNDIO_CFLAGS)
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c
index b8cc1a8ca..abf37f1b3 100644
--- a/src/audio_out/audio_alsa_out.c
+++ b/src/audio_out/audio_alsa_out.c
@@ -50,10 +50,10 @@
#include <inttypes.h>
#include <pthread.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/audio_out.h>
/*
#define ALSA_LOG
@@ -63,7 +63,7 @@
#define LOG_DEBUG
*/
-#define AO_OUT_ALSA_IFACE_VERSION 8
+#define AO_OUT_ALSA_IFACE_VERSION 9
#define BUFFER_TIME 1000*1000
#define GAP_TOLERANCE 5000
@@ -138,7 +138,7 @@ static int my_snd_mixer_wait(snd_mixer_t *mixer, int timeout) {
return count;
if ((unsigned int) count > sizeof(spfds) / sizeof(spfds[0])) {
- pfds = malloc(count * sizeof(*pfds));
+ pfds = calloc(count, sizeof(*pfds));
if (!pfds)
return -ENOMEM;
@@ -1696,22 +1696,6 @@ static void alsa_speaker_arrangement_cb (void *user_data,
/*
* class functions
*/
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "alsa";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using alsa-compliant audio devices/drivers");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- alsa_class_t *this = (alsa_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
alsa_class_t *this;
@@ -1721,9 +1705,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
+ this->driver_class.identifier = "alsa";
+ this->driver_class.description = N_("xine audio output plugin using alsa-compliant audio devices/drivers");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
/* this->config = xine->config; */
this->xine = xine;
diff --git a/src/audio_out/audio_arts_out.c b/src/audio_out/audio_arts_out.c
deleted file mode 100644
index 7f796f2b3..000000000
--- a/src/audio_out/audio_arts_out.c
+++ /dev/null
@@ -1,416 +0,0 @@
-/*
- * Copyright (C) 2000-2003 the xine project
- *
- * This file is part of xine, a free video player.
- *
- * xine is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * xine is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <math.h>
-#include <unistd.h>
-#include <inttypes.h>
-#include <artsc.h>
-
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
-#include "bswap.h"
-
-#define AO_OUT_ARTS_IFACE_VERSION 8
-
-#define AUDIO_NUM_FRAGMENTS 15
-#define AUDIO_FRAGMENT_SIZE 8192
-
-#define GAP_TOLERANCE AO_MAX_GAP
-
-typedef struct arts_driver_s {
-
- ao_driver_t ao_driver;
-
- xine_t *xine;
-
- arts_stream_t audio_stream;
- int capabilities;
- int mode;
-
- int32_t sample_rate;
- uint32_t num_channels;
- uint32_t bits_per_sample;
- uint32_t bytes_per_frame;
-
- uint32_t latency;
-
- struct {
- int volume;
- int mute;
- int vol_scale;
- int v_mixer;
- } mixer;
-
-} arts_driver_t;
-
-typedef struct {
- audio_driver_class_t driver_class;
-
- xine_t *xine;
- int inited;
-} arts_class_t;
-
-/*
- * Software stereo volume control.....
- * Igor Mokrushin <igor@avtomir.ru>
- */
-static void ao_arts_volume(void *buffer, int length, int volume) {
- int v;
- short *data = (short *)buffer;
-
- while (length--) {
- v=(int) ((*(data) * volume) / 100);
- *(data)=(v>32767) ? 32767 : ((v<-32768) ? -32768 : v);
- *(data)=_X_LE_16(data);
- data++;
- }
-}
-/* End volume control */
-
-/*
- * open the audio device for writing to
- */
-static int ao_arts_open(ao_driver_t *this_gen,
- uint32_t bits, uint32_t rate, int mode)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- xprintf (this->xine, XINE_VERBOSITY_DEBUG,
- "audio_arts_out: ao_open bits=%d rate=%d, mode=%d\n", bits, rate, mode);
-
- if ( (mode & this->capabilities) == 0 ) {
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_arts_out: unsupported mode %08x\n", mode);
- return 0;
- }
-
- if (this->audio_stream) {
-
- if ( (mode == this->mode) && (rate == this->sample_rate) )
- return this->sample_rate;
-
- sleep(2); /* arts might segfault if we are still playing */
- arts_close_stream(this->audio_stream);
- }
-
- this->mode = mode;
- this->sample_rate = rate;
- this->bits_per_sample = bits;
-
- switch (mode) {
- case AO_CAP_MODE_MONO:
- this->num_channels = 1;
- break;
- case AO_CAP_MODE_STEREO:
- this->num_channels = 2;
- break;
- }
-
- this->bytes_per_frame=(this->bits_per_sample*this->num_channels)/8;
-
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_arts_out: %d channels output\n", this->num_channels);
-
- this->audio_stream=arts_play_stream(this->sample_rate, bits, this->num_channels, "xine");
-
- this->latency = arts_stream_get (this->audio_stream, ARTS_P_TOTAL_LATENCY);
-
- /* try to keep latency low, if we don't do this we might end
- with very high latencies for low quality sound and audio_out will
- try to fill gaps every time...(values in ms) */
- if( this->latency > 800 )
- {
- this->latency = 800 - arts_stream_get (this->audio_stream, ARTS_P_SERVER_LATENCY);
- if( this->latency < 100 )
- this->latency = 100;
- arts_stream_set( this->audio_stream, ARTS_P_BUFFER_TIME, this->latency );
- this->latency = arts_stream_get (this->audio_stream, ARTS_P_TOTAL_LATENCY);
- }
-
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_arts_out : latency %d ms\n", this->latency);
-
- return this->sample_rate;
-}
-
-
-static int ao_arts_num_channels(ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
- return this->num_channels;
-}
-
-static int ao_arts_bytes_per_frame(ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
- return this->bytes_per_frame;
-}
-
-static int ao_arts_get_gap_tolerance (ao_driver_t *this_gen)
-{
- return GAP_TOLERANCE;
-}
-
-static int ao_arts_write(ao_driver_t *this_gen, int16_t *data,
- uint32_t num_frames)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
- int size = num_frames * this->bytes_per_frame;
-
- ao_arts_volume(data, num_frames * this->num_channels, this->mixer.vol_scale );
- arts_write(this->audio_stream, data, size );
-
- return 1;
-}
-
-
-static int ao_arts_delay (ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- /* Just convert latency (ms) to frame units.
- please note that there is no function in aRts C API to
- get the current buffer utilization. This is, at best,
- a very roughly aproximation.
- */
-
- return this->latency * this->sample_rate / 1000;
-}
-
-static void ao_arts_close(ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- if (this->audio_stream) {
- sleep(2); /* arts might segfault if we are still playing */
- arts_close_stream(this->audio_stream);
- this->audio_stream = NULL;
- }
-}
-
-static uint32_t ao_arts_get_capabilities (ao_driver_t *this_gen) {
- arts_driver_t *this = (arts_driver_t *) this_gen;
- return this->capabilities;
-}
-
-static void ao_arts_exit(ao_driver_t *this_gen)
-{
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- ao_arts_close(this_gen);
- /* FIXME: arts_free() freezes on BSD, so don't use it there */
-#if !defined(__OpenBSD__) && !defined (__FreeBSD__) && !defined(__NetBSD__)
- arts_free();
-#endif
-
- free (this);
-}
-
-static int ao_arts_get_property (ao_driver_t *this_gen, int property) {
-
- arts_driver_t *this = (arts_driver_t *) this_gen;
-
- switch(property) {
- case AO_PROP_PCM_VOL:
- case AO_PROP_MIXER_VOL:
- if(!this->mixer.mute)
- this->mixer.volume = this->mixer.vol_scale;
- return this->mixer.volume;
- break;
- case AO_PROP_MUTE_VOL:
- return this->mixer.mute;
- break;
- }
- return 0;
-}
-
-static int ao_arts_set_property (ao_driver_t *this_gen, int property, int value) {
-
- arts_driver_t *this = (arts_driver_t *) this_gen;
- int mute = (value) ? 1 : 0;
-
- switch(property) {
- case AO_PROP_PCM_VOL:
- case AO_PROP_MIXER_VOL:
- if(!this->mixer.mute)
- this->mixer.volume = value;
- this->mixer.vol_scale = this->mixer.volume;
- return this->mixer.volume;
- break;
- case AO_PROP_MUTE_VOL:
- if(mute) {
- this->mixer.v_mixer = this->mixer.volume;
- this->mixer.volume = 0;
- this->mixer.vol_scale = this->mixer.volume;
- } else {
- this->mixer.volume = this->mixer.v_mixer;
- this->mixer.vol_scale = this->mixer.volume;
- }
- this->mixer.mute = mute;
- return value;
- break;
- }
-
- return ~value;
-}
-
-static int ao_arts_ctrl(ao_driver_t *this_gen, int cmd, ...) {
- /*arts_driver_t *this = (arts_driver_t *) this_gen;*/
-
- switch (cmd) {
-
- case AO_CTRL_PLAY_PAUSE:
- break;
-
- case AO_CTRL_PLAY_RESUME:
- break;
-
- case AO_CTRL_FLUSH_BUFFERS:
- break;
- }
-
- return 0;
-}
-
-static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *data) {
- arts_class_t *class = (arts_class_t *) class_gen;
- arts_driver_t *this;
- int rc;
-
- lprintf ("audio_arts_out: open_plugin called\n");
-
- this = calloc(1, sizeof (arts_driver_t));
- if (!this)
- return NULL;
-
- this->xine = class->xine;
-
- if (class->inited == 0) {
- rc = arts_init();
- class->inited++;
- } else {
- xprintf (this->xine, XINE_VERBOSITY_LOG, "audio_arts_out: not trying to initialise a second time\n");
- free(this);
- return NULL;
- }
-
- if (rc < 0) {
- xprintf (this->xine, XINE_VERBOSITY_DEBUG,"audio_arts_out: arts_init failed: %s\n", arts_error_text(rc));
- free(this);
- return NULL;
- }
-
- /*
- * set volume control
- */
- this->mixer.mute = 0;
- this->mixer.vol_scale = 60;
- this->mixer.v_mixer = 0;
- /*
- * set capabilities
- */
- this->capabilities = 0;
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "audio_arts_out : supported modes are ");
- this->capabilities |= AO_CAP_MODE_MONO | AO_CAP_MIXER_VOL | AO_CAP_PCM_VOL | AO_CAP_MUTE_VOL;
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "mono ");
- this->capabilities |= AO_CAP_MODE_STEREO | AO_CAP_MIXER_VOL | AO_CAP_PCM_VOL | AO_CAP_MUTE_VOL;
- xprintf (this->xine, XINE_VERBOSITY_DEBUG, "stereo ");
-
- this->sample_rate = 0;
- this->audio_stream = NULL;
-
- this->ao_driver.get_capabilities = ao_arts_get_capabilities;
- this->ao_driver.get_property = ao_arts_get_property;
- this->ao_driver.set_property = ao_arts_set_property;
- this->ao_driver.open = ao_arts_open;
- this->ao_driver.num_channels = ao_arts_num_channels;
- this->ao_driver.bytes_per_frame = ao_arts_bytes_per_frame;
- this->ao_driver.delay = ao_arts_delay;
- this->ao_driver.write = ao_arts_write;
- this->ao_driver.close = ao_arts_close;
- this->ao_driver.exit = ao_arts_exit;
- this->ao_driver.get_gap_tolerance = ao_arts_get_gap_tolerance;
- this->ao_driver.control = ao_arts_ctrl;
-
- return &this->ao_driver;
-}
-
-/*
- * class functions
- */
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "arts";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using kde artsd");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- arts_class_t *this = (arts_class_t *) this_gen;
-
- free (this);
-}
-
-static void *init_class (xine_t *xine, void *data) {
-
- arts_class_t *this;
-
- lprintf ("audio_arts_out: init class\n");
-
- this = calloc(1, sizeof (arts_class_t));
- if (!this)
- return NULL;
-
- this->inited = 0;
-
- this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
-
- this->xine = xine;
-
- return this;
-}
-
-static ao_info_t ao_info_arts = {
- 5
-};
-
-/*
- * exported plugin catalog entry
- */
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_OUT, AO_OUT_ARTS_IFACE_VERSION, "arts", XINE_VERSION_CODE, &ao_info_arts, init_class },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
-
diff --git a/src/audio_out/audio_coreaudio_out.c b/src/audio_out/audio_coreaudio_out.c
index 5e31a15e5..acee16750 100644
--- a/src/audio_out/audio_coreaudio_out.c
+++ b/src/audio_out/audio_coreaudio_out.c
@@ -41,9 +41,9 @@
#include <unistd.h>
#include <inttypes.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
#include <CoreAudio/CoreAudio.h>
#include <CoreAudio/CoreAudioTypes.h>
@@ -52,7 +52,7 @@
#include <AudioUnit/AudioUnitParameters.h>
#include <AudioUnit/AudioOutputUnit.h>
-#define AO_OUT_COREAUDIO_IFACE_VERSION 8
+#define AO_OUT_COREAUDIO_IFACE_VERSION 9
#define GAP_TOLERANCE AO_MAX_GAP
#define BUFSIZE 30720
@@ -560,22 +560,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
/*
* class functions
*/
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "coreaudio";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine output plugin for Coreaudio/Mac OS X");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- coreaudio_class_t *this = (coreaudio_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
coreaudio_class_t *this;
@@ -587,9 +571,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
+ this->driver_class.identifier = "coreaudio";
+ this->driver_class.description = N_("xine output plugin for Coreaudio/Mac OS X");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
diff --git a/src/audio_out/audio_directx2_out.c b/src/audio_out/audio_directx2_out.c
index 335aad1a7..de1aadd2a 100644
--- a/src/audio_out/audio_directx2_out.c
+++ b/src/audio_out/audio_directx2_out.c
@@ -61,12 +61,11 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
-#define AO_OUT_DIRECTX2_IFACE_VERSION 8
-
+#define AO_OUT_DIRECTX2_IFACE_VERSION 9
/*
* If GAP_TOLERANCE is lower than AO_MAX_GAP, xine will
@@ -936,22 +935,6 @@ static ao_driver_t *open_plugin(audio_driver_class_t *class_gen, const void *dat
return (ao_driver_t *)this;
}
-
-static char* get_identifier(audio_driver_class_t *this_gen) {
- return "directx2";
-}
-
-
-static char *get_description(audio_driver_class_t *this_gen) {
- return _("second xine audio output plugin using directx");
-}
-
-
-static void dispose_class(audio_driver_class_t *this_gen) {
- free(this_gen);
-}
-
-
static void *init_class(xine_t *xine, void *data) {
dx2_class_t *this;
@@ -962,9 +945,9 @@ static void *init_class(xine_t *xine, void *data) {
return NULL;
this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
+ this->driver_class.identifier = "directx2";
+ this->driver_class.description = N_("second xine audio output plugin using directx");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->xine = xine;
diff --git a/src/audio_out/audio_directx_out.c b/src/audio_out/audio_directx_out.c
index 893a11976..0df4b21de 100644
--- a/src/audio_out/audio_directx_out.c
+++ b/src/audio_out/audio_directx_out.c
@@ -38,8 +38,8 @@ typedef unsigned char boolean;
#define LOG
*/
-#include "audio_out.h"
-#include "xine_internal.h"
+#include <xine/audio_out.h>
+#include <xine/xine_internal.h>
#define MAX_CHANNELS 6
@@ -52,7 +52,7 @@ typedef unsigned char boolean;
#define DSBUFF_LEFT 1
#define DSBUFF_RIGHT 2
-#define AO_DIRECTX_IFACE_VERSION 8
+#define AO_DIRECTX_IFACE_VERSION 9
/*****************************************************************************
* DirectDraw GUIDs.
@@ -823,20 +823,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
return ( ao_driver_t * ) ao_directx;
}
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "DirectX";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin for win32 using directx");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
- audiox_class_t *audiox = (audiox_class_t *) this_gen;
-
- free (audiox);
-}
-
static void *init_class (xine_t *xine, void *data) {
audiox_class_t *audiox;
@@ -850,9 +836,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
audiox->driver_class.open_plugin = open_plugin;
- audiox->driver_class.get_identifier = get_identifier;
- audiox->driver_class.get_description = get_description;
- audiox->driver_class.dispose = dispose_class;
+ audiox->driver_class.identifier = "DirectX";
+ audiox->driver_class.description = N_("xine audio output plugin for win32 using directx");
+ audiox->driver_class.dispose = default_audio_driver_class_dispose;
audiox->xine = xine;
audiox->config = xine->config;
diff --git a/src/audio_out/audio_esd_out.c b/src/audio_out/audio_esd_out.c
index ae7576259..917a4bfab 100644
--- a/src/audio_out/audio_esd_out.c
+++ b/src/audio_out/audio_esd_out.c
@@ -33,12 +33,12 @@
#include <sys/uio.h>
#include <inttypes.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
-#include "metronom.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
+#include <xine/metronom.h>
-#define AO_OUT_ESD_IFACE_VERSION 8
+#define AO_OUT_ESD_IFACE_VERSION 9
#define REBLOCK 1 /* reblock output to ESD_BUF_SIZE blks */
#define GAP_TOLERANCE 5000
@@ -563,22 +563,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
/*
* class functions
*/
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "esd";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using esound");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- esd_class_t *this = (esd_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
esd_class_t *this;
@@ -588,9 +572,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
+ this->driver_class.identifier = "esd";
+ this->driver_class.description = N_("xine audio output plugin using esound");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->xine = xine;
diff --git a/src/audio_out/audio_file_out.c b/src/audio_out/audio_file_out.c
index bc40d4efd..0a4471a19 100644
--- a/src/audio_out/audio_file_out.c
+++ b/src/audio_out/audio_file_out.c
@@ -32,12 +32,12 @@
#include <inttypes.h>
#include <sys/stat.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
#include "bswap.h"
-#define AO_OUT_FILE_IFACE_VERSION 8
+#define AO_OUT_FILE_IFACE_VERSION 9
#define GAP_TOLERANCE INT_MAX
@@ -85,7 +85,7 @@ typedef struct file_driver_s {
uint32_t bits_per_sample;
uint32_t bytes_per_frame;
- char *fname;
+ const char *fname;
int fd;
size_t bytes_written;
struct timeval endtime;
@@ -376,22 +376,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
/*
* class functions
*/
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "file";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine file audio output plugin");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- file_class_t *this = (file_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
file_class_t *this;
@@ -403,9 +387,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
+ this->driver_class.identifier = "file";
+ this->driver_class.description = N_("xine file audio output plugin");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
diff --git a/src/audio_out/audio_fusionsound_out.c b/src/audio_out/audio_fusionsound_out.c
index 873ab32e9..c3455fd14 100644
--- a/src/audio_out/audio_fusionsound_out.c
+++ b/src/audio_out/audio_fusionsound_out.c
@@ -34,9 +34,9 @@
#define LOG_VERBOSE
#include "xine.h"
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/xineutils.h>
#include <directfb.h>
@@ -48,8 +48,14 @@
FUSIONSOUND_MINOR_VERSION, \
FUSIONSOUND_MICRO_VERSION )
+#if FUSIONSOUND_VERSION_CODE >= VERSION_CODE(1,1,0)
+# include <fusionsound_limits.h> /* defines FS_MAX_CHANNELS */
+#else
+# define FS_MAX_CHANNELS 2
+#endif
+
-#define AO_OUT_FS_IFACE_VERSION 8
+#define AO_OUT_FS_IFACE_VERSION 9
#define GAP_TOLERANCE 5000
@@ -100,7 +106,29 @@ static int ao_fusionsound_open(ao_driver_t *ao_driver,
break;
case AO_CAP_MODE_STEREO:
dsc.channels = 2;
- break;
+ break;
+#if FS_MAX_CHANNELS > 2
+ case AO_CAP_MODE_4CHANNEL:
+ dsc.channels = 4;
+ dsc.channelmode = FSCM_SURROUND40_2F2R;
+ dsc.flags |= FSBDF_CHANNELMODE;
+ break;
+ case AO_CAP_MODE_4_1CHANNEL:
+ dsc.channels = 5;
+ dsc.channelmode = FSCM_SURROUND41_2F2R;
+ dsc.flags |= FSBDF_CHANNELMODE;
+ break;
+ case AO_CAP_MODE_5CHANNEL:
+ dsc.channels = 5;
+ dsc.channelmode = FSCM_SURROUND50;
+ dsc.flags |= FSBDF_CHANNELMODE;
+ break;
+ case AO_CAP_MODE_5_1CHANNEL:
+ dsc.channels = 6;
+ dsc.channelmode = FSCM_SURROUND51;
+ dsc.flags |= FSBDF_CHANNELMODE;
+ break;
+#endif
default:
xprintf (this->xine, XINE_VERBOSITY_LOG,
"audio_fusionsound_out: mode %#x not supported\n", mode);
@@ -250,13 +278,18 @@ static void ao_fusionsound_close(ao_driver_t *ao_driver){
*/
static uint32_t ao_fusionsound_get_capabilities(ao_driver_t *ao_driver) {
+ uint32_t caps = AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO |
+ AO_CAP_MIXER_VOL | AO_CAP_MUTE_VOL |
+ AO_CAP_8BITS | AO_CAP_16BITS |
+ AO_CAP_24BITS;
#if FUSIONSOUND_VERSION_CODE >= VERSION_CODE(0,9,26)
- return (AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO | AO_CAP_MIXER_VOL |
- AO_CAP_8BITS | AO_CAP_16BITS | AO_CAP_24BITS | AO_CAP_FLOAT32);
-#else
- return (AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO | AO_CAP_MIXER_VOL |
- AO_CAP_8BITS | AO_CAP_16BITS | AO_CAP_24BITS);
+ caps |= AO_CAP_FLOAT32;
+#endif
+#if FS_MAX_CHANNELS > 2
+ caps |= AO_CAP_MODE_4CHANNEL | AO_CAP_MODE_4_1CHANNEL |
+ AO_CAP_MODE_5CHANNEL | AO_CAP_MODE_5_1CHANNEL;
#endif
+ return caps;
}
static void ao_fusionsound_exit(ao_driver_t *ao_driver) {
@@ -434,18 +467,6 @@ static ao_driver_t* open_plugin(audio_driver_class_t *ao_class,
* class functions
*/
-static char* get_identifier(audio_driver_class_t *ao_class) {
- return "FusionSound";
-}
-
-static char* get_description(audio_driver_class_t *ao_class) {
- return "xine FusionSound audio output plugin";
-}
-
-static void dispose_class(audio_driver_class_t *ao_class) {
- free (ao_class);
-}
-
static void* init_class(xine_t *xine, void *data) {
fusionsound_class_t *class;
const char *error;
@@ -468,9 +489,9 @@ static void* init_class(xine_t *xine, void *data) {
}
class->ao_class.open_plugin = open_plugin;
- class->ao_class.get_identifier = get_identifier;
- class->ao_class.get_description = get_description;
- class->ao_class.dispose = dispose_class;
+ class->ao_class.identifier = "FunsionSound";
+ class->ao_class.description = N_("xine FusionSound audio output plugin");
+ class->ao_class.dispose = default_audio_driver_class_dispose;
class->xine = xine;
return class;
diff --git a/src/audio_out/audio_irixal_out.c b/src/audio_out/audio_irixal_out.c
index 336996a99..3a0f21196 100644
--- a/src/audio_out/audio_irixal_out.c
+++ b/src/audio_out/audio_irixal_out.c
@@ -37,10 +37,10 @@
#include <dmedia/audio.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/audio_out.h>
//#ifndef AFMT_S16_NE
//# if defined(sparc) || defined(__sparc__) || defined(PPC)
diff --git a/src/audio_out/audio_jack_out.c b/src/audio_out/audio_jack_out.c
index 1fadb3a13..975a5f38a 100644
--- a/src/audio_out/audio_jack_out.c
+++ b/src/audio_out/audio_jack_out.c
@@ -11,13 +11,13 @@
#include <unistd.h>
#include <inttypes.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
#include <jack/jack.h>
-#define AO_OUT_JACK_IFACE_VERSION 8
+#define AO_OUT_JACK_IFACE_VERSION 9
#define GAP_TOLERANCE AO_MAX_GAP
/* maximum number of channels supported, avoids lots of mallocs */
@@ -896,38 +896,23 @@ static void jack_speaker_arrangement_cb (void *user_data,
/*
* class functions
*/
+static void *init_class (xine_t *xine, void *data) {
-static char *get_identifier (audio_driver_class_t *this_gen)
-{
- return "jack";
-}
-
-static char *get_description (audio_driver_class_t *this_gen)
-{
- return _("xine output plugin for JACK Audio Connection Kit");
-}
+ jack_class_t *this;
-static void dispose_class (audio_driver_class_t *this_gen)
-{
- jack_class_t *this = (jack_class_t *) this_gen;
- free (this);
-}
-
-static void *init_class (xine_t *xine, void *data)
-{
- jack_class_t *this;
+ this = calloc(1, sizeof (jack_class_t));
- this = calloc(1, sizeof (jack_class_t));
+ this->driver_class.open_plugin = open_jack_plugin;
+ this->driver_class.identifier = "jack";
+ this->driver_class.description = N_("xine output plugin for JACK Audio Connection Kit");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
- this->driver_class.open_plugin = open_jack_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
+ this->config = xine->config;
+ this->xine = xine;
- this->config = xine->config;
- this->xine = xine;
+ fprintf(stderr, "jack init_class returning %p\n", (void *)this);
- return this;
+ return this;
}
static ao_info_t ao_info_jack = { 6 };
@@ -937,8 +922,7 @@ static ao_info_t ao_info_jack = { 6 };
*/
const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_OUT, AO_OUT_JACK_IFACE_VERSION, "jack", XINE_VERSION_CODE,
- &ao_info_jack, init_class },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_AUDIO_OUT, AO_OUT_JACK_IFACE_VERSION, "jack", XINE_VERSION_CODE /* XINE_VERSION_CODE */, &ao_info_jack, init_class },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/audio_out/audio_none_out.c b/src/audio_out/audio_none_out.c
index c3d351035..c63d3a563 100644
--- a/src/audio_out/audio_none_out.c
+++ b/src/audio_out/audio_none_out.c
@@ -31,11 +31,11 @@
#include <unistd.h>
#include <inttypes.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
-#define AO_OUT_NONE_IFACE_VERSION 8
+#define AO_OUT_NONE_IFACE_VERSION 9
#define AUDIO_NUM_FRAGMENTS 15
#define AUDIO_FRAGMENT_SIZE 8192
@@ -214,22 +214,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
/*
* class functions
*/
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "none";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine dummy audio output plugin");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- none_class_t *this = (none_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
none_class_t *this;
@@ -241,9 +225,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
+ this->driver_class.identifier = "none";
+ this->driver_class.description = N_("xine dummy audio output plugin");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c
index a68c6bd71..06d9115ef 100644
--- a/src/audio_out/audio_oss_out.c
+++ b/src/audio_out/audio_oss_out.c
@@ -64,10 +64,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/audio_out.h>
#include <sys/time.h>
@@ -93,7 +93,7 @@
# define AFMT_AC3 0x00000400
#endif
-#define AO_OUT_OSS_IFACE_VERSION 8
+#define AO_OUT_OSS_IFACE_VERSION 9
#define AUDIO_NUM_FRAGMENTS 15
#define AUDIO_FRAGMENT_SIZE 8192
@@ -660,7 +660,7 @@ static int ao_oss_ctrl(ao_driver_t *this_gen, int cmd, ...) {
* If not, the function returns 0.
*/
static int probe_audio_devices(oss_driver_t *this) {
- const char *base_names[2] = {"/dev/dsp", "/dev/sound/dsp"};
+ static const char *const base_names[2] = {"/dev/dsp", "/dev/sound/dsp"};
int base_num, i;
int audio_fd, rate;
int best_rate;
@@ -1040,14 +1040,10 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
parse += 3;
if (devname_val == 0)
snprintf(mixer_dev, sizeof(mixer_dev), "%smixer%s", mixer_name, parse);
- else {
- if (mixer_num == -1)
- snprintf(mixer_dev, sizeof(mixer_dev), "%smixer", mixer_name);
- else
- snprintf(mixer_dev, sizeof(mixer_dev), "%smixer%d", mixer_name, mixer_num);
- }
- } else {
- _x_abort();
+ else if (mixer_num == -1)
+ snprintf(mixer_dev, sizeof(mixer_dev), "%smixer", mixer_name);
+ else
+ snprintf(mixer_dev, sizeof(mixer_dev), "%smixer%d", mixer_name, mixer_num);
}
this->mixer.fd = xine_open_cloexec(mixer_dev, O_RDONLY);
@@ -1145,22 +1141,6 @@ static void oss_speaker_arrangement_cb (void *user_data,
/*
* class functions
*/
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "oss";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using oss-compliant audio devices/drivers");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- oss_class_t *this = (oss_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
oss_class_t *this;
@@ -1170,9 +1150,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
+ this->driver_class.identifier = "oss";
+ this->driver_class.description = N_("xine audio output plugin using oss-compliant audio devices/drivers");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c
index 93e134785..5370389c7 100644
--- a/src/audio_out/audio_pulse_out.c
+++ b/src/audio_out/audio_pulse_out.c
@@ -41,9 +41,9 @@
#include <pulse/pulseaudio.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
#include "bswap.h"
#define GAP_TOLERANCE AO_MAX_GAP
@@ -954,14 +954,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
* class functions
*/
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "pulseaudio";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using pulseaudio sound server");
-}
-
static void dispose_class (audio_driver_class_t *this_gen) {
pulse_class_t *this = (pulse_class_t *) this_gen;
@@ -981,9 +973,9 @@ static void *init_class (xine_t *xine, void *data) {
this->xine = xine;
this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
this->driver_class.dispose = dispose_class;
+ this->driver_class.identifier = "pulseaudio";
+ this->driver_class.description = N_("xine audio output plugin using pulseaudio sound server");
return this;
}
@@ -998,6 +990,6 @@ static const ao_info_t ao_info_pulse = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_OUT, 8, "pulseaudio", XINE_VERSION_CODE, &ao_info_pulse, init_class },
+ { PLUGIN_AUDIO_OUT, 9, "pulseaudio", XINE_VERSION_CODE, &ao_info_pulse, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/audio_out/audio_sndio_out.c b/src/audio_out/audio_sndio_out.c
index 1d789b5e8..55d479963 100644
--- a/src/audio_out/audio_sndio_out.c
+++ b/src/audio_out/audio_sndio_out.c
@@ -32,9 +32,9 @@
#include <sndio.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
#include "bswap.h"
#define GAP_TOLERANCE AO_MAX_GAP
@@ -362,16 +362,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
* class functions
*/
-static char* get_identifier (audio_driver_class_t *this_gen)
-{
- return "sndio";
-}
-
-static char* get_description (audio_driver_class_t *this_gen)
-{
- return _("xine audio output plugin using sndio audio devices/drivers ");
-}
-
static void dispose_class (audio_driver_class_t *this_gen)
{
sndio_class_t *this = (sndio_class_t *) this_gen;
@@ -390,8 +380,8 @@ static void *init_class (xine_t *xine, void *data)
return NULL;
this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
+ this->driver_class.identifier = "sndio";
+ this->driver_class.description = N_("xine audio output plugin using sndio audio devices/drivers ");
this->driver_class.dispose = dispose_class;
this->xine = xine;
@@ -409,6 +399,6 @@ static const ao_info_t ao_info_sndio = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_OUT, 8, "sndio", XINE_VERSION_CODE, &ao_info_sndio, init_class },
+ { PLUGIN_AUDIO_OUT, 9, "sndio", XINE_VERSION_CODE, &ao_info_sndio, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c
index cd6319ee8..34d2f14ec 100644
--- a/src/audio_out/audio_sun_out.c
+++ b/src/audio_out/audio_sun_out.c
@@ -45,9 +45,9 @@
typedef unsigned uint_t;
#endif
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
#ifdef __svr4__
#define CS4231_WORKAROUND 1 /* enable workaround for audiocs play.samples bug */
@@ -64,7 +64,7 @@ typedef unsigned uint_t;
#define AUDIO_PRECISION_16 16
#endif
-#define AO_SUN_IFACE_VERSION 8
+#define AO_SUN_IFACE_VERSION 9
#define GAP_TOLERANCE 5000
#define GAP_NONRT_TOLERANCE AO_MAX_GAP
@@ -246,13 +246,11 @@ static int realtime_samplecounter_available(xine_t *xine, char *dev)
error:
if (silence != NULL) free(silence);
if (fd >= 0) {
-#ifdef __svr4__
/*
* remove the 0 bytes from the above measurement from the
* audio driver's STREAMS queue
*/
ioctl(fd, I_FLUSH, FLUSHW);
-#endif
close(fd);
}
@@ -332,7 +330,7 @@ find_close_samplerate_match(int dev, int sample_rate)
#else
int i, err;
- int audiocs_rates[] = {
+ static const int audiocs_rates[] = {
5510, 6620, 8000, 9600, 11025, 16000, 18900, 22050,
27420, 32000, 33075, 37800, 44100, 48000, 0
};
@@ -1013,22 +1011,6 @@ static ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const v
/*
* class functions
*/
-
-static char* ao_sun_get_identifier (audio_driver_class_t *this_gen) {
- return "sun";
-}
-
-static char* ao_sun_get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using sun-compliant audio devices/drivers");
-}
-
-static void ao_sun_dispose_class (audio_driver_class_t *this_gen) {
-
- sun_class_t *this = (sun_class_t *) this_gen;
-
- free (this);
-}
-
static void *ao_sun_init_class (xine_t *xine, void *data) {
sun_class_t *this;
@@ -1037,9 +1019,9 @@ static void *ao_sun_init_class (xine_t *xine, void *data) {
return NULL;
this->driver_class.open_plugin = ao_sun_open_plugin;
- this->driver_class.get_identifier = ao_sun_get_identifier;
- this->driver_class.get_description = ao_sun_get_description;
- this->driver_class.dispose = ao_sun_dispose_class;
+ this->driver_class.identifier = "sun";
+ this->driver_class.description = N_("xine audio output plugin using sun-compliant audio devices/drivers");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->xine = xine;