From 39fe4d0cd39059a6b020bf82a055bf51bac3c58b Mon Sep 17 00:00:00 2001 From: arpi Date: Fri, 1 Nov 2002 17:46:45 +0000 Subject: verbose can be negative git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8028 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_sdl.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'libao2/ao_sdl.c') diff --git a/libao2/ao_sdl.c b/libao2/ao_sdl.c index 37bfe1e1cc..2c7a699b61 100644 --- a/libao2/ao_sdl.c +++ b/libao2/ao_sdl.c @@ -13,6 +13,9 @@ #include #include +#include "../config.h" +#include "../mp_msg.h" + #include "audio_out.h" #include "audio_out_internal.h" #include "afmt.h" @@ -30,9 +33,6 @@ static ao_info_t info = LIBAO_EXTERN(sdl) - -extern int verbose; - // Samplesize used by the SDLlib AudioSpec struct #define SAMPLESIZE 1024 @@ -153,11 +153,11 @@ static int init(int rate,int channels,int format,int flags){ /* Allocate ring-buffer memory */ for(i=0;i 1) ? "Stereo" : "Mono", audio_out_format_name(format)); + mp_msg(MSGT_AO,MSGL_INFO,"SDL: Samplerate: %iHz Channels: %s Format %s\n", rate, (channels > 1) ? "Stereo" : "Mono", audio_out_format_name(format)); if(ao_subdevice) { setenv("SDL_AUDIODRIVER", ao_subdevice, 1); - printf("SDL: using %s audio driver\n", ao_subdevice); + mp_msg(MSGT_AO,MSGL_INFO,"SDL: using %s audio driver\n", ao_subdevice); } ao_data.channels=channels; @@ -189,7 +189,7 @@ static int init(int rate,int channels,int format,int flags){ aspec.format = AUDIO_U16MSB; break; default: - printf("SDL: Unsupported audio format: 0x%x.\n", format); + mp_msg(MSGT_AO,MSGL_WARN,"SDL: Unsupported audio format: 0x%x.\n", format); return 0; } @@ -211,13 +211,13 @@ void callback(void *userdata, Uint8 *stream, int len); userdata is the pointer s /* initialize the SDL Audio system */ if (SDL_Init (SDL_INIT_AUDIO/*|SDL_INIT_NOPARACHUTE*/)) { - printf("SDL: Initializing of SDL Audio failed: %s.\n", SDL_GetError()); + mp_msg(MSGT_AO,MSGL_ERR,"SDL: Initializing of SDL Audio failed: %s.\n", SDL_GetError()); return 0; } /* Open the audio device and start playing sound! */ if(SDL_OpenAudio(&aspec, &obtained) < 0) { - printf("SDL: Unable to open audio: %s\n", SDL_GetError()); + mp_msg(MSGT_AO,MSGL_ERR,"SDL: Unable to open audio: %s\n", SDL_GetError()); return(0); } @@ -245,11 +245,11 @@ void callback(void *userdata, Uint8 *stream, int len); userdata is the pointer s ao_data.format = AFMT_U16_BE; break; default: - printf("SDL: Unsupported SDL audio format: 0x%x.\n", obtained.format); + mp_msg(MSGT_AO,MSGL_WARN,"SDL: Unsupported SDL audio format: 0x%x.\n", obtained.format); return 0; } - if(verbose) printf("SDL: buf size = %d\n",obtained.size); + mp_msg(MSGT_AO,MSGL_V,"SDL: buf size = %d\n",obtained.size); ao_data.buffersize=obtained.size; /* unsilence audio, if callback is ready */ @@ -260,7 +260,7 @@ void callback(void *userdata, Uint8 *stream, int len); userdata is the pointer s // close audio device static void uninit(){ - if(verbose) printf("SDL: Audio Subsystem shutting down!\n"); + mp_msg(MSGT_AO,MSGL_V,"SDL: Audio Subsystem shutting down!\n"); SDL_CloseAudio(); SDL_QuitSubSystem(SDL_INIT_AUDIO); } -- cgit v1.2.3