From edd36a3afce4ca3778461e61df64f6a79ba94079 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 22 Aug 2013 23:12:35 +0200 Subject: audio/out: do some mp_msg conversions Use the new MP_ macros for some AOs instead of mp_msg. Not all AOs are converted, and some only partially. In some cases, some additional cosmetic changes are made. --- audio/out/ao_sdl.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'audio/out/ao_sdl.c') diff --git a/audio/out/ao_sdl.c b/audio/out/ao_sdl.c index 231b40681a..4ca153b4dd 100644 --- a/audio/out/ao_sdl.c +++ b/audio/out/ao_sdl.c @@ -124,7 +124,7 @@ static unsigned int ceil_power_of_two(unsigned int x) static int init(struct ao *ao) { if (SDL_WasInit(SDL_INIT_AUDIO)) { - mp_msg(MSGT_AO, MSGL_ERR, "[sdl] already initialized\n"); + MP_ERR(ao, "already initialized\n"); return -1; } @@ -132,7 +132,7 @@ static int init(struct ao *ao) if (SDL_InitSubSystem(SDL_INIT_AUDIO)) { if (!ao->probing) - mp_msg(MSGT_AO, MSGL_ERR, "[sdl] SDL_Init failed\n"); + MP_ERR(ao, "SDL_Init failed\n"); uninit(ao, true); return -1; } @@ -174,24 +174,23 @@ static int init(struct ao *ao) desired.callback = audio_callback; desired.userdata = ao; - mp_msg(MSGT_AO, MSGL_V, "[sdl] requested format: %d Hz, %d channels, %x, " - "buffer size: %d samples\n", - (int) desired.freq, (int) desired.channels, - (int) desired.format, (int) desired.samples); + MP_VERBOSE(ao, "requested format: %d Hz, %d channels, %x, " + "buffer size: %d samples\n", + (int) desired.freq, (int) desired.channels, + (int) desired.format, (int) desired.samples); obtained = desired; if (SDL_OpenAudio(&desired, &obtained)) { if (!ao->probing) - mp_msg(MSGT_AO, MSGL_ERR, "[sdl] could not open audio: %s\n", - SDL_GetError()); + MP_ERR(ao, "could not open audio: %s\n", SDL_GetError()); uninit(ao, true); return -1; } - mp_msg(MSGT_AO, MSGL_V, "[sdl] obtained format: %d Hz, %d channels, %x, " - "buffer size: %d samples\n", - (int) obtained.freq, (int) obtained.channels, - (int) obtained.format, (int) obtained.samples); + MP_VERBOSE(ao, "obtained format: %d Hz, %d channels, %x, " + "buffer size: %d samples\n", + (int) obtained.freq, (int) obtained.channels, + (int) obtained.format, (int) obtained.samples); switch (obtained.format) { case AUDIO_U8: ao->format = AF_FORMAT_U8; break; @@ -214,8 +213,7 @@ static int init(struct ao *ao) #endif default: if (!ao->probing) - mp_msg(MSGT_AO, MSGL_ERR, - "[sdl] could not find matching format\n"); + MP_ERR(ao, "could not find matching format\n"); uninit(ao, true); return -1; } @@ -229,13 +227,13 @@ static int init(struct ao *ao) priv->buffer = av_fifo_alloc(obtained.size * priv->bufcnt); priv->buffer_mutex = SDL_CreateMutex(); if (!priv->buffer_mutex) { - mp_msg(MSGT_AO, MSGL_ERR, "[sdl] SDL_CreateMutex failed\n"); + MP_ERR(ao, "SDL_CreateMutex failed\n"); uninit(ao, true); return -1; } priv->underrun_cond = SDL_CreateCond(); if (!priv->underrun_cond) { - mp_msg(MSGT_AO, MSGL_ERR, "[sdl] SDL_CreateCond failed\n"); + MP_ERR(ao, "SDL_CreateCond failed\n"); uninit(ao, true); return -1; } -- cgit v1.2.3