From fb29effbbc643215c92fd20a9b97410d4dfc7498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 4 Apr 2007 13:13:26 +0200 Subject: Check for audio_info_t.output_muted member, rather than assuming it's not available on NetBSD only. With this, it's not needed to check for OpenBSD too. Thanks to Pascal S. de Kloe for pointing at it. --- src/audio_out/audio_sun_out.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c index 93361d2f3..9d9ede32c 100644 --- a/src/audio_out/audio_sun_out.c +++ b/src/audio_out/audio_sun_out.c @@ -807,7 +807,7 @@ static int ao_sun_get_property (ao_driver_t *this_gen, int property) { this->mixer_volume = info.play.gain * 100 / AUDIO_MAX_GAIN; } return this->mixer_volume; -#if !defined(__NetBSD__) /* audio_info.output_muted is missing on NetBSD */ +#ifdef HAVE_AUDIO_INFO_T_OUTPUT_MUTED case AO_PROP_MUTE_VOL: if (ioctl(this->audio_fd, AUDIO_GETINFO, &info) < 0) return 0; @@ -836,7 +836,7 @@ static int ao_sun_set_property (ao_driver_t *this_gen, int property, int value) if (ioctl(this->audio_fd, AUDIO_SETINFO, &info) < 0) return ~value; return value; -#if !defined(__NetBSD__) /* audio_info.output_muted is missing on NetBSD */ +#ifdef HAVE_AUDIO_INFO_T_OUTPUT_MUTED case AO_PROP_MUTE_VOL: info.output_muted = value != 0; if (ioctl(this->audio_fd, AUDIO_SETINFO, &info) < 0) -- cgit v1.2.3 From 06c436dc328c0b0b364cab793d4b283a14f303f8 Mon Sep 17 00:00:00 2001 From: "Pascal S. de Kloe" Date: Wed, 4 Apr 2007 13:13:59 +0200 Subject: Use size_t for samples and seconds data in Sun audio plugin. --- src/audio_out/audio_sun_out.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c index 9d9ede32c..5923eb658 100644 --- a/src/audio_out/audio_sun_out.c +++ b/src/audio_out/audio_sun_out.c @@ -126,10 +126,10 @@ typedef struct sun_driver_s { #ifdef __svr4__ #if SW_SAMPLE_COUNT struct timeval tv0; - uint_t sample0; + size_t sample0; #endif - uint_t last_samplecnt; + size_t last_samplecnt; #endif } sun_driver_t; @@ -604,8 +604,8 @@ static int ao_sun_delay(ao_driver_t *this_gen) /* compute "current sample" based on real time */ { struct timeval tv1; - uint_t cur_sample; - uint_t msec; + size_t cur_sample; + size_t msec; gettimeofday(&tv1, NULL); -- cgit v1.2.3 From 76e028c87087ca9e897a1d3b564379e67e3ce58a Mon Sep 17 00:00:00 2001 From: "Pascal S. de Kloe" Date: Wed, 4 Apr 2007 13:16:06 +0200 Subject: When EOVERFLOW is not defined, use EINVAL instead. --- src/input/input_dvb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 39507ac15..10d6eca55 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -986,8 +986,13 @@ static int tuner_tune_it (tuner_t *this, struct dvb_frontend_parameters if (poll(pfd,1,3000)){ if (pfd[0].revents & POLLIN){ - if (ioctl(this->fd_frontend, FE_GET_EVENT, &event) == -EOVERFLOW){ +#ifdef EOVERFLOW + if (ioctl(this->fd_frontend, FE_GET_EVENT, &event) == -EOVERFLOW) { print_error("EOVERFLOW"); +#else + if (ioctl(this->fd_frontend, FE_GET_EVENT, &event) == -EINVAL) { + print_error("EINVAL"); +#endif return 0; } if (event.parameters.frequency <= 0) -- cgit v1.2.3 From 11256a884cae65ebfce0bc98cb5d034e431557c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 4 Apr 2007 13:38:41 +0200 Subject: Check for sys/dvdio.h, and use that if found, rather than having a check for the BSDs. Thanks to Pascal S. de Kloe for pointing at this. --- src/input/input_dvd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 944ae88bd..14ff8c9e8 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -64,11 +64,11 @@ #endif /* WIN32 */ -#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) +#if defined(HAVE_LINUX_CDROM_H) +#include +#elif defined(HAVE_SYS_DVDIO_H) #include #include /* CDIOCALLOW etc... */ -#elif defined(HAVE_LINUX_CDROM_H) -#include #elif defined(HAVE_SYS_CDIO_H) #include #else -- cgit v1.2.3 From b34dcf208b9c69bfda299ab6fe035ad99ed7ec01 Mon Sep 17 00:00:00 2001 From: "Pascal S. de Kloe" Date: Wed, 4 Apr 2007 13:41:11 +0200 Subject: Cleanup check for WIN32, use #elif rather than #else/#ifdef. --- src/input/input_dvd.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 14ff8c9e8..de47de0d5 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -71,14 +71,10 @@ #include /* CDIOCALLOW etc... */ #elif defined(HAVE_SYS_CDIO_H) #include -#else - -#ifdef WIN32 +#elif defined(WIN32) #include /* read() */ #else #warning "This might not compile due to missing cdrom ioctls" -#endif /* WIN32 */ - #endif /* DVDNAV includes */ -- cgit v1.2.3 From e5fac215b15506fb7b5d1238ee5e579a427eefd6 Mon Sep 17 00:00:00 2001 From: "Pascal S. de Kloe" Date: Wed, 4 Apr 2007 13:44:50 +0200 Subject: Check for previous swap32 definition before writing a new swap32 function. --- src/libmusepack/diff_against_svn.patch | 20 ++++++++++++++++++++ src/libmusepack/musepack/internal.h | 2 ++ 2 files changed, 22 insertions(+) (limited to 'src') diff --git a/src/libmusepack/diff_against_svn.patch b/src/libmusepack/diff_against_svn.patch index aca00556c..1d44efb95 100644 --- a/src/libmusepack/diff_against_svn.patch +++ b/src/libmusepack/diff_against_svn.patch @@ -1,5 +1,6 @@ Use xine's inttypes. The file config_types.h is generated from config_types.h.in in musepack SVN. +Check for previous swap32 definition before writing a new swap32 function. Index: src/libmusepack/musepack/config_types.h =================================================================== @@ -33,3 +34,22 @@ diff -u -r1.1 synth_filter.c /* C O N S T A N T S */ #undef _ +diff -r d25b274e6e6a src/libmusepack/musepack/internal.h +--- a/src/libmusepack/musepack/internal.h Wed Apr 04 13:41:11 2007 +0200 ++++ b/src/libmusepack/musepack/internal.h Wed Apr 04 13:42:45 2007 +0200 +@@ -8,6 +8,7 @@ enum { + MPC_DECODER_SYNTH_DELAY = 481 + }; + ++#ifndef swap32 + /// Big/little endian 32 bit byte swapping routine. + static inline + mpc_uint32_t swap32(mpc_uint32_t val) { +@@ -16,6 +17,7 @@ mpc_uint32_t swap32(mpc_uint32_t val) { + (mpc_uint32_t)src[0] | + ((mpc_uint32_t)src[1] << 8) | ((mpc_uint32_t)src[2] << 16) | ((mpc_uint32_t)src[3] << 24); + } ++#endif + + /// Searches for a ID3v2-tag and reads the length (in bytes) of it. + /// \param reader supplying raw stream data diff --git a/src/libmusepack/musepack/internal.h b/src/libmusepack/musepack/internal.h index 42a0e7156..f86b45bb3 100644 --- a/src/libmusepack/musepack/internal.h +++ b/src/libmusepack/musepack/internal.h @@ -8,6 +8,7 @@ enum { MPC_DECODER_SYNTH_DELAY = 481 }; +#ifndef swap32 /// Big/little endian 32 bit byte swapping routine. static inline mpc_uint32_t swap32(mpc_uint32_t val) { @@ -16,6 +17,7 @@ mpc_uint32_t swap32(mpc_uint32_t val) { (mpc_uint32_t)src[0] | ((mpc_uint32_t)src[1] << 8) | ((mpc_uint32_t)src[2] << 16) | ((mpc_uint32_t)src[3] << 24); } +#endif /// Searches for a ID3v2-tag and reads the length (in bytes) of it. /// \param reader supplying raw stream data -- cgit v1.2.3