summaryrefslogtreecommitdiffstats
path: root/libao2/ao_sdl.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-11-01 17:46:45 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-11-01 17:46:45 +0000
commit39fe4d0cd39059a6b020bf82a055bf51bac3c58b (patch)
tree89ce3b5e666c35fee409f680e4365c024f12f4ad /libao2/ao_sdl.c
parent94b6f5babac8c35c6ffcd238985980fc44aa3eeb (diff)
downloadmpv-39fe4d0cd39059a6b020bf82a055bf51bac3c58b.tar.bz2
mpv-39fe4d0cd39059a6b020bf82a055bf51bac3c58b.tar.xz
verbose can be negative
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8028 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2/ao_sdl.c')
-rw-r--r--libao2/ao_sdl.c22
1 files changed, 11 insertions, 11 deletions
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 <stdio.h>
#include <stdlib.h>
+#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<NUM_BUFS;i++) buffer[i]=(unsigned char *) malloc(BUFFSIZE);
- printf("SDL: Samplerate: %iHz Channels: %s Format %s\n", rate, (channels > 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);
}