summaryrefslogtreecommitdiff
path: root/src/audio_out
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio_out')
-rw-r--r--src/audio_out/Makefile.am108
-rw-r--r--src/audio_out/audio_arts_out.c416
-rw-r--r--src/audio_out/audio_pulse_out.c12
-rw-r--r--src/audio_out/audio_sun_out.c4
4 files changed, 43 insertions, 497 deletions
diff --git a/src/audio_out/Makefile.am b/src/audio_out/Makefile.am
index b984de7de..6eafd507e 100644
--- a/src/audio_out/Makefile.am
+++ b/src/audio_out/Makefile.am
@@ -1,146 +1,116 @@
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
-##
-# 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) \
+ $(fusionsound_module) \
$(jack_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_none_la_LDFLAGS = -avoid-version -module
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_file_la_LDFLAGS = -avoid-version -module
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_oss_la_LDFLAGS = -avoid-version -module
xineplug_ao_out_alsa_la_SOURCES = audio_alsa_out.c
xineplug_ao_out_alsa_la_LIBADD = $(ALSA_LIBS) $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_ao_out_alsa_la_CFLAGS = $(VISIBILITY_FLAG) $(ALSA_CFLAGS)
-xineplug_ao_out_alsa_la_LDFLAGS = -avoid-version -module
+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 = $(ESD_LIBS) $(XINE_LIB) $(LTLIBINTL)
-xineplug_ao_out_esd_la_CFLAGS = $(VISIBILITY_FLAG) $(ESD_CFLAGS)
-xineplug_ao_out_esd_la_LDFLAGS = -avoid-version -module
+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_sun_la_LDFLAGS = -avoid-version -module
#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_irixal_la_LDFLAGS = -avoid-version -module
-
-xineplug_ao_out_arts_la_SOURCES = audio_arts_out.c
-xineplug_ao_out_arts_la_LIBADD = $(ARTS_LIBS) $(XINE_LIB)
-xineplug_ao_out_arts_la_CFLAGS = $(VISIBILITY_FLAG) $(ARTS_CFLAGS)
-xineplug_ao_out_arts_la_LDFLAGS = -avoid-version -module
+#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 = $(DIRECTX_AUDIO_LIBS) $(XINE_LIB)
-xineplug_ao_out_directx_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_ao_out_directx_la_LDFLAGS = -avoid-version -module
+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 = \
- -Wl,-framework -Wl,Cocoa -framework CoreAudio \
- -Wl,-framework -Wl,AudioUnit -framework AudioUnit \
- -avoid-version -module
-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 = $(PULSEAUDIO_LIBS) $(XINE_LIB) $(LTLIBINTL)
-xineplug_ao_out_pulseaudio_la_CFLAGS = $(VISIBILITY_FLAG) $(PULSEAUDIO_CFLAGS)
-xineplug_ao_out_pulseaudio_la_LDFLAGS = -avoid-version -module
+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_CPPFLAGS = $(AM_CPPFLAGS) $(DIRECTX_CPPFLAGS)
xineplug_ao_out_directx2_la_LIBADD = $(XINE_LIB) $(DIRECTX_AUDIO_LIBS) $(PTHREAD_LIBS)
-xineplug_ao_out_directx2_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_ao_out_directx2_la_LDFLAGS = -avoid-version -module
xineplug_ao_out_fusionsound_la_SOURCES = audio_fusionsound_out.c
xineplug_ao_out_fusionsound_la_LIBADD = $(FUSIONSOUND_LIBS) $(XINE_LIB)
-xineplug_ao_out_fusionsound_la_CFLAGS = $(VISIBILITY_FLAG) $(FUSIONSOUND_CFLAGS)
-xineplug_ao_out_fusionsound_la_LDFLAGS = -avoid-version -module
+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 = $(JACK_LIBS) $(XINE_LIB) $(LTLIBINTL)
-xineplug_ao_out_jack_la_CFLAGS = $(VISIBILITY_FLAG) $(JACK_CFLAGS)
-xineplug_ao_out_jack_la_LDFLAGS = -avoid-version -module
+xineplug_ao_out_jack_la_CFLAGS = $(AM_FLAGS) $(JACK_CFLAGS)
diff --git a/src/audio_out/audio_arts_out.c b/src/audio_out/audio_arts_out.c
deleted file mode 100644
index 0f0467b4a..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 = (arts_driver_t *) xine_xmalloc (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 = (arts_class_t *) xine_xmalloc (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_pulse_out.c b/src/audio_out/audio_pulse_out.c
index dfd825047..7baaeaf7f 100644
--- a/src/audio_out/audio_pulse_out.c
+++ b/src/audio_out/audio_pulse_out.c
@@ -76,7 +76,7 @@ typedef struct pulse_driver_s {
int capabilities;
int mode;
- int32_t sample_rate;
+ uint32_t sample_rate;
uint32_t num_channels;
uint32_t bits_per_sample;
uint32_t bytes_per_frame;
@@ -339,7 +339,7 @@ static int ao_pulse_write(ao_driver_t *this_gen, int16_t *data,
uint32_t num_frames)
{
pulse_driver_t *this = (pulse_driver_t *) this_gen;
- int size = num_frames * this->bytes_per_frame;
+ size_t size = num_frames * this->bytes_per_frame;
int ret = 0;
if ( !this->stream || !this->pa_class->context)
@@ -378,7 +378,7 @@ static int ao_pulse_delay (ao_driver_t *this_gen)
{
pulse_driver_t *this = (pulse_driver_t *) this_gen;
pa_usec_t latency = 0;
- int delay_frames;
+ unsigned int delay_frames;
if ( ! this->stream ) return this->frames_written;
@@ -623,12 +623,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
this->pa_class = class;
return &this->ao_driver;
-
- fail:
- pthread_mutex_unlock(&this->pa_class->pa_mutex);
- free(this);
- xprintf (class->xine, XINE_VERBOSITY_DEBUG, "audio_pulse_out: open_plugin failed.\n");
- return NULL;
}
/*
diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c
index b23955b77..838230dbe 100644
--- a/src/audio_out/audio_sun_out.c
+++ b/src/audio_out/audio_sun_out.c
@@ -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
};