summaryrefslogtreecommitdiff
path: root/src/audio_out
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2001-11-30 00:53:50 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2001-11-30 00:53:50 +0000
commit873578a7965683e3e76420731c1d571908b54848 (patch)
treecd8153e478f39f9aac7c851672996a8e58ace71e /src/audio_out
parentad5f52afbed82f29ba0816255edf1ff63533a2ff (diff)
downloadxine-lib-873578a7965683e3e76420731c1d571908b54848.tar.gz
xine-lib-873578a7965683e3e76420731c1d571908b54848.tar.bz2
Valid mrls are no more static (except few ones), like file suffix too.
First draft of compat.h (almost empty for now). CVS patchset: 1139 CVS date: 2001/11/30 00:53:50
Diffstat (limited to 'src/audio_out')
-rw-r--r--src/audio_out/audio_alsa_out.c26
-rw-r--r--src/audio_out/audio_irixal_out.c38
-rw-r--r--src/audio_out/audio_oss_out.c9
3 files changed, 23 insertions, 50 deletions
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c
index 54001e355..b3f2687c2 100644
--- a/src/audio_out/audio_alsa_out.c
+++ b/src/audio_out/audio_alsa_out.c
@@ -26,7 +26,7 @@
* (c) 2001 James Courtier-Dutton <James@superbug.demon.co.uk>
*
*
- * $Id: audio_alsa_out.c,v 1.39 2001/11/28 23:15:09 jcdutton Exp $
+ * $Id: audio_alsa_out.c,v 1.40 2001/11/30 00:53:50 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -45,23 +45,9 @@
#include <sys/ioctl.h>
#include <inttypes.h>
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-#define error(...) do {\
- fprintf(stderr, "XINE lib %s:%d:(%s) ", __FILE__, __LINE__, __FUNCTION__); \
- fprintf(stderr, __VA_ARGS__); \
- putc('\n', stderr); \
-} while (0)
-#else
-#define error(args...) do {\
- fprintf(stderr, "XINE lib %s:%d:(%s) ", __FILE__, __LINE__, __FUNCTION__); \
- fprintf(stderr, ##args); \
- putc('\n', stderr); \
-} while (0)
-#endif
-
-
#include "xine_internal.h"
#include "xineutils.h"
+#include "compat.h"
#include "audio_out.h"
#ifndef AFMT_S16_NE
@@ -236,7 +222,7 @@ static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int
printf("audio_alsa_out: Number of channels = %d\n",this->num_channels);
if (this->audio_fd != NULL) {
- error ("Already open...WHY!");
+ xlerror ("Already open...WHY!");
snd_pcm_close (this->audio_fd);
}
@@ -351,7 +337,7 @@ static int ao_alsa_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int
tmp = snd_pcm_hw_params_set_period_size_near(this->audio_fd, params,
period_size, 0);
printf("audio_alsa_out:open:period_size=%ld tmp=%ld\n",period_size,tmp);
-
+
if (period_size < 0) {
printf ("audio_alsa_out: period size not available");
goto __close;
@@ -843,8 +829,8 @@ ao_driver_t *init_audio_out_plugin (config_values_t *config) {
err=snd_pcm_open(&this->audio_fd, pcm_device, SND_PCM_STREAM_PLAYBACK, 0);
if(err <0 ) {
- error("snd_pcm_open() failed: %d", err);
- error(">>> Check if another program don't already use PCM <<<");
+ xlerror("snd_pcm_open() failed: %d", err);
+ xlerror(">>> Check if another program don't already use PCM <<<");
return NULL;
}
diff --git a/src/audio_out/audio_irixal_out.c b/src/audio_out/audio_irixal_out.c
index 56e857283..b7fc38971 100644
--- a/src/audio_out/audio_irixal_out.c
+++ b/src/audio_out/audio_irixal_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_irixal_out.c,v 1.3 2001/11/17 14:26:37 f1rmb Exp $
+ * $Id: audio_irixal_out.c,v 1.4 2001/11/30 00:53:50 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -36,23 +36,9 @@
#include <dmedia/audio.h>
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-#define error(...) do {\
- fprintf(stderr, "XINE lib %s:%d:(%s) ", __FILE__, __LINE__, __FUNCTION__); \
- fprintf(stderr, __VA_ARGS__); \
- putc('\n', stderr); \
-} while (0)
-#else
-#define error(args...) do {\
- fprintf(stderr, "XINE lib %s:%d:(%s) ", __FILE__, __LINE__, __FUNCTION__); \
- fprintf(stderr, ##args); \
- putc('\n', stderr); \
-} while (0)
-#endif
-
-
#include "xine_internal.h"
#include "xineutils.h"
+#include "compat.h"
#include "audio_out.h"
//#ifndef AFMT_S16_NE
@@ -124,18 +110,18 @@ static int ao_irixal_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, i
break;
#endif
default:
- error ("irixal Driver does not support the requested mode: 0x%x",mode);
+ xlerror ("irixal Driver does not support the requested mode: 0x%x",mode);
return 0;
}
if (! (config = alNewConfig ()))
{
- error ("cannot get new config: %s", strerror (oserror()));
+ xlerror ("cannot get new config: %s", strerror (oserror()));
return 0;
}
if ( (alSetChannels (config, this->num_channels)) == -1)
{
- error ("cannot set to %d channels: %s", this->num_channels, strerror (oserror()));
+ xlerror ("cannot set to %d channels: %s", this->num_channels, strerror (oserror()));
alFreeConfig (config);
return 0;
}
@@ -144,7 +130,7 @@ static int ao_irixal_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, i
case 8:
if ( (alSetWidth (config, AL_SAMPLE_8)) == -1)
{
- error ("cannot set 8bit mode: %s", strerror (oserror()));
+ xlerror ("cannot set 8bit mode: %s", strerror (oserror()));
alFreeConfig (config);
return 0;
}
@@ -153,7 +139,7 @@ static int ao_irixal_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, i
/* Default format is 16bit PCM */
break;
default:
- error ("irixal Driver does not support %dbit audio", bits);
+ xlerror ("irixal Driver does not support %dbit audio", bits);
alFreeConfig (config);
return 0;
}
@@ -164,7 +150,7 @@ static int ao_irixal_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, i
* Try to open audio port
*/
if (! (this->port = alOpenPort ("xine", "w", config))) {
- error ("irixal Driver does not support the audio configuration");
+ xlerror ("irixal Driver does not support the audio configuration");
alFreeConfig (config);
return 0;
}
@@ -193,7 +179,7 @@ static int ao_irixal_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, i
printf ("audio_irixal: FYI: cannot set sample rate, using software resampling\n");
if (alGetParams (resource, &parvalue, 1) == -1)
{
- error ("cannot ask for current sample rate, assuming everything worked...");
+ xlerror ("cannot ask for current sample rate, assuming everything worked...");
this->output_sample_rate = this->input_sample_rate;
}
else
@@ -231,7 +217,7 @@ static int ao_irixal_delay (ao_driver_t *this_gen)
int frames_left;
if (alGetFrameTime (this->port, &stamp, &time) == -1)
- error ("alGetFrameNumber failed");
+ xlerror ("alGetFrameNumber failed");
frames_left = this->frames_in_buffer - stamp;
if (frames_left <= 0) /* buffer ran dry */
frames_left = 0;
@@ -249,7 +235,7 @@ static int ao_irixal_write(ao_driver_t *this_gen,int16_t *data, uint32_t num_fra
/* get absolute number of samples played so far
* note: this counts up when run dry as well... */
if (alGetFrameNumber (this->port, &stamp) == -1)
- error ("alGetFrameNumber failed");
+ xlerror ("alGetFrameNumber failed");
if (this->frames_in_buffer < stamp) /* dry run */
{
if (this->frames_in_buffer > 0)
@@ -327,7 +313,7 @@ ao_driver_t *init_audio_out_plugin (config_values_t *config)
}
if (useresource == -1)
{
- error ("cannot find output resource");
+ xlerror ("cannot find output resource");
return NULL;
}
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c
index d4b22806b..2da37be12 100644
--- a/src/audio_out/audio_oss_out.c
+++ b/src/audio_out/audio_oss_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_oss_out.c,v 1.51 2001/11/18 15:08:30 guenter Exp $
+ * $Id: audio_oss_out.c,v 1.52 2001/11/30 00:53:50 f1rmb Exp $
*
* 20-8-2001 First implementation of Audio sync and Audio driver separation.
* Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk
@@ -61,6 +61,7 @@
#include "xine_internal.h"
#include "xineutils.h"
+#include "compat.h"
#include "audio_out.h"
#include <sys/time.h>
@@ -432,7 +433,7 @@ static int ao_oss_get_property (ao_driver_t *this_gen, int property) {
}
else
printf("%s(): open() %s failed: %s\n",
- __FUNCTION__, this->mixer.name, strerror(errno));
+ __XINE_FUNCTION__, this->mixer.name, strerror(errno));
return this->mixer.volume;
break;
@@ -482,7 +483,7 @@ static int ao_oss_set_property (ao_driver_t *this_gen, int property, int value)
}
else
printf("%s(): open() %s failed: %s\n",
- __FUNCTION__, this->mixer.name, strerror(errno));
+ __XINE_FUNCTION__, this->mixer.name, strerror(errno));
}
else
this->mixer.volume = value;
@@ -518,7 +519,7 @@ static int ao_oss_set_property (ao_driver_t *this_gen, int property, int value)
}
else
printf("%s(): open() %s failed: %s\n",
- __FUNCTION__, this->mixer.name, strerror(errno));
+ __XINE_FUNCTION__, this->mixer.name, strerror(errno));
}
else
(void) ao_oss_set_property(&this->ao_driver, this->mixer.prop, this->mixer.volume);