diff options
Diffstat (limited to 'src/audio_out/audio_sun_out.c')
-rw-r--r-- | src/audio_out/audio_sun_out.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c index 5de3841d9..8a8882761 100644 --- a/src/audio_out/audio_sun_out.c +++ b/src/audio_out/audio_sun_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_sun_out.c,v 1.32 2003/11/29 15:41:37 miguelfreitas Exp $ + * $Id: audio_sun_out.c,v 1.33 2003/12/05 15:54:56 f1rmb Exp $ */ #ifdef HAVE_CONFIG_H @@ -126,7 +126,7 @@ typedef struct sun_driver_s { * try to figure out, if the soundcard driver provides usable (precise) * sample counter information */ -static int realtime_samplecounter_available(char *dev) +static int realtime_samplecounter_available(xine_t *xine, char *dev) { int fd = -1; audio_info_t info; @@ -162,17 +162,17 @@ static int realtime_samplecounter_available(char *dev) info.play.encoding = AUDIO_ENCODING_LINEAR; info.play.samples = 0; if (ioctl(fd, AUDIO_SETINFO, &info)) { - fprintf(stderr, "rtsc: SETINFO failed\n"); + xprintf(xine, XINE_VERBOSITY_DEBUG, "rtsc: SETINFO failed\n"); goto error; } if (write(fd, silence, len) != len) { - fprintf(stderr, "rtsc: write failed\n"); + xprintf(xine, XINE_VERBOSITY_DEBUG, "rtsc: write failed\n"); goto error; } if (ioctl(fd, AUDIO_GETINFO, &info)) { - fprintf(stderr, "rtsc: GETINFO1, %s\n", strerror(errno)); + xprintf(xine, XINE_VERBOSITY_DEBUG, "rtsc: GETINFO1, %s\n", strerror(errno)); goto error; } @@ -194,11 +194,11 @@ static int realtime_samplecounter_available(char *dev) break; if (ioctl(fd, AUDIO_GETINFO, &info)) { - fprintf(stderr, "rtsc: GETINFO2 failed, %s\n", strerror(errno)); + xprintf(xine, XINE_VERBOSITY_DEBUG, "rtsc: GETINFO2 failed, %s\n", strerror(errno)); goto error; } if (info.play.samples < last_samplecnt) { - fprintf(stderr, "rtsc: %u > %u?\n", last_samplecnt, info.play.samples); + xprintf(xine, XINE_VERBOSITY_DEBUG, "rtsc: %u > %u?\n", last_samplecnt, info.play.samples); goto error; } @@ -412,10 +412,10 @@ static int ao_sun_open(ao_driver_t *this_gen, int pass; int ok; - xprintf(this->xine, XINE_VERBOSITY_LOG, "audio_sun_out: ao_sun_open rate=%d, mode=%d\n", rate, mode); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_sun_out: ao_sun_open rate=%d, mode=%d\n", rate, mode); if ( (mode & this->capabilities) == 0 ) { - xprintf(this->xine, XINE_VERBOSITY_LOG, "audio_sun_out: unsupported mode %08x\n", mode); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_sun_out: unsupported mode %08x\n", mode); return 0; } @@ -437,8 +437,8 @@ static int ao_sun_open(ao_driver_t *this_gen, this->audio_fd = open(this->audio_dev, O_WRONLY|O_NONBLOCK); if(this->audio_fd < 0) { - fprintf(stderr, "audio_sun_out: Opening audio device %s failed: %s\n", - this->audio_dev, strerror(errno)); + xprintf(this->xine, XINE_VERBOSITY_LOG, + _("audio_sun_out: Opening audio device %s failed: %s\n"), this->audio_dev, strerror(errno)); return 0; } @@ -514,8 +514,8 @@ static int ao_sun_open(ao_driver_t *this_gen, } if (!ok) { - fprintf(stderr, "audio_sun_out: Cannot configure audio device for " - "%dhz, %d channel, %d bits: %s\n", + xprintf(this->xine, XINE_VERBOSITY_DEBUG, + "audio_sun_out: Cannot configure audio device for %dhz, %d channel, %d bits: %s\n", rate, info.play.channels, bits, strerror(errno)); close(this->audio_fd); this->audio_fd = -1; @@ -542,7 +542,7 @@ static int ao_sun_open(ao_driver_t *this_gen, this->input_sample_rate, this->output_sample_rate); */ - xprintf(this->xine, XINE_VERBOSITY_LOG, "audio_sun_out: %d channels output\n",this->num_channels); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_sun_out: %d channels output\n",this->num_channels); return this->output_sample_rate; } @@ -567,8 +567,9 @@ static int ao_sun_delay(ao_driver_t *this_gen) (this->frames_in_buffer == 0 || info.play.samples > 0)) { if (info.play.samples < this->last_samplecnt) { - fprintf(stderr, "audio_sun_out: broken sound driver, sample counter runs backwards, cur %u < prev %u\n", - info.play.samples, this->last_samplecnt); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, + "audio_sun_out: broken sound driver, sample counter runs backwards, cur %u < prev %u\n", + info.play.samples, this->last_samplecnt); } this->last_samplecnt = info.play.samples; @@ -875,7 +876,7 @@ static ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const v int status; audio_info_t info; - this = (sun_driver_t *) malloc (sizeof (sun_driver_t)); + this = (sun_driver_t *) xine_xmalloc (sizeof (sun_driver_t)); this->xine = class->xine; @@ -894,7 +895,7 @@ static ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const v * find best device driver/channel */ - xprintf(this->xine, XINE_VERBOSITY_LOG, "audio_sun_out: Opening audio device %s...\n", devname); + xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_sun_out: Opening audio device %s...\n", devname); /* * open the device @@ -904,8 +905,8 @@ static ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const v if(audio_fd < 0) { - fprintf(stderr, "audio_sun_out: opening audio device %s failed: %s\n", - devname, strerror(errno)); + xprintf(this->xine, XINE_VERBOSITY_LOG, + _("audio_sun_out: opening audio device %s failed: %s\n"), devname, strerror(errno)); free (this); return NULL; @@ -933,7 +934,7 @@ static ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const v this->xine = class->xine; this->audio_fd = -1; - this->use_rtsc = realtime_samplecounter_available(this->audio_dev); + this->use_rtsc = realtime_samplecounter_available(this->xine, this->audio_dev); this->output_sample_rate = 0; this->ao_driver.get_capabilities = ao_sun_get_capabilities; @@ -974,7 +975,7 @@ static void ao_sun_dispose_class (audio_driver_class_t *this_gen) { static void *ao_sun_init_class (xine_t *xine, void *data) { sun_class_t *this; - this = (sun_class_t *) malloc (sizeof (sun_class_t)); + this = (sun_class_t *) xine_xmalloc (sizeof (sun_class_t)); this->driver_class.open_plugin = ao_sun_open_plugin; this->driver_class.get_identifier = ao_sun_get_identifier; |