summaryrefslogtreecommitdiffstats
path: root/libao2/ao_sdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libao2/ao_sdl.c')
-rw-r--r--libao2/ao_sdl.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/libao2/ao_sdl.c b/libao2/ao_sdl.c
index 66d37eae77..b5c56d9f33 100644
--- a/libao2/ao_sdl.c
+++ b/libao2/ao_sdl.c
@@ -36,7 +36,7 @@
#include "libavutil/fifo.h"
-static const ao_info_t info =
+static const ao_info_t info =
{
"SDLlib audio output",
"sdl",
@@ -129,7 +129,7 @@ static int init(int rate,int channels,int format,int flags){
/* SDL Audio Specifications */
SDL_AudioSpec aspec, obtained;
-
+
/* Allocate ring-buffer memory */
buffer = av_fifo_alloc(BUFFSIZE);
@@ -147,7 +147,7 @@ static int init(int rate,int channels,int format,int flags){
ao_data.bps=channels*rate;
if(format != AF_FORMAT_U8 && format != AF_FORMAT_S8)
ao_data.bps*=2;
-
+
/* The desired audio format (see SDL_AudioSpec) */
switch(format) {
case AF_FORMAT_U8:
@@ -200,7 +200,7 @@ void callback(void *userdata, Uint8 *stream, int len); userdata is the pointer s
if(SDL_OpenAudio(&aspec, &obtained) < 0) {
mp_tmsg(MSGT_AO,MSGL_ERR,"[AO SDL] Unable to open audio: %s\n", SDL_GetError());
return 0;
- }
+ }
/* did we got what we wanted ? */
ao_data.channels=obtained.channels;
@@ -233,7 +233,7 @@ void callback(void *userdata, Uint8 *stream, int len); userdata is the pointer s
mp_msg(MSGT_AO,MSGL_V,"SDL: buf size = %d\n",obtained.size);
ao_data.buffersize=obtained.size;
ao_data.outburst = CHUNK_SIZE;
-
+
/* unsilence audio, if callback is ready */
SDL_PauseAudio(0);
@@ -253,7 +253,7 @@ static void uninit(int immed){
// stop playing and empty buffers (for seeking/pause)
static void reset(void){
- //printf("SDL: reset called!\n");
+ //printf("SDL: reset called!\n");
SDL_PauseAudio(1);
/* Reset ring-buffer state */
@@ -265,15 +265,15 @@ static void reset(void){
static void audio_pause(void)
{
- //printf("SDL: audio_pause called!\n");
+ //printf("SDL: audio_pause called!\n");
SDL_PauseAudio(1);
-
+
}
// resume playing, after audio_pause()
static void audio_resume(void)
{
- //printf("SDL: audio_resume called!\n");
+ //printf("SDL: audio_resume called!\n");
SDL_PauseAudio(0);
}
@@ -290,12 +290,12 @@ static int play(void* data,int len,int flags){
if (!(flags & AOPLAY_FINAL_CHUNK))
len = (len/ao_data.outburst)*ao_data.outburst;
-#if 0
+#if 0
int ret;
/* Audio locking prohibits call of outputaudio */
SDL_LockAudio();
- // copy audio stream into ring-buffer
+ // copy audio stream into ring-buffer
ret = write_buffer(data, len);
SDL_UnlockAudio();
@@ -310,9 +310,3 @@ static float get_delay(void){
int buffered = av_fifo_size(buffer); // could be less
return (float)(buffered + ao_data.buffersize)/(float)ao_data.bps;
}
-
-
-
-
-
-