From 0eb321bf2c1cc0e048faff26a01f86cdd3ec254f Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Tue, 7 Jul 2009 02:26:13 +0300 Subject: Remove trailing whitespace from most files --- libao2/ao_sgi.c | 68 ++++++++++++++++++++++++++------------------------------- 1 file changed, 31 insertions(+), 37 deletions(-) (limited to 'libao2/ao_sgi.c') diff --git a/libao2/ao_sgi.c b/libao2/ao_sgi.c index 8a2899d915..71ce784657 100644 --- a/libao2/ao_sgi.c +++ b/libao2/ao_sgi.c @@ -32,7 +32,7 @@ #include "help_mp.h" #include "libaf/af_format.h" -static const ao_info_t info = +static const ao_info_t info = { "sgi audio output", "sgi", @@ -116,9 +116,9 @@ static int fmt2sgial(int *format, int *width) { // to set/get/query special features/parameters static int control(int cmd, void *arg){ - + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO SGI] control.\n"); - + switch(cmd) { case AOCONTROL_QUERY_FORMAT: /* Do not reject any format: return the closest matching @@ -139,9 +139,9 @@ static int init(int rate, int channels, int format, int flags) { smpfmt = fmt2sgial(&format, &smpwidth); mp_tmsg(MSGT_AO, MSGL_INFO, "[AO SGI] init: Samplerate: %iHz Channels: %s Format %s\n", rate, (channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format)); - + { /* from /usr/share/src/dmedia/audio/setrate.c */ - + double frate, realrate; ALpv x[2]; @@ -152,9 +152,9 @@ static int init(int rate, int channels, int format, int flags) { return 0; } } - + frate = rate; - + x[0].param = AL_RATE; x[0].value.ll = alDoubleToFixed(rate); x[1].param = AL_MASTER_CLOCK; @@ -163,7 +163,7 @@ static int init(int rate, int channels, int format, int flags) { if (alSetParams(rv,x, 2)<0) { mp_tmsg(MSGT_AO, MSGL_WARN, "[AO SGI] init: setparams failed: %s\nCould not set desired samplerate.\n", alGetErrorString(oserror())); } - + if (x[0].sizeOut < 0) { mp_tmsg(MSGT_AO, MSGL_WARN, "[AO SGI] init: AL_RATE was not accepted on the given resource.\n"); } @@ -171,14 +171,14 @@ static int init(int rate, int channels, int format, int flags) { if (alGetParams(rv,x, 1)<0) { mp_tmsg(MSGT_AO, MSGL_WARN, "[AO SGI] init: getparams failed: %s\n", alGetErrorString(oserror())); } - + realrate = alFixedToDouble(x[0].value.ll); if (frate != realrate) { mp_tmsg(MSGT_AO, MSGL_INFO, "[AO SGI] init: samplerate is now %lf (desired rate is %lf)\n", realrate, frate); - } + } sample_rate = (int)realrate; } - + bytes_per_frame = channels * smpwidth; ao_data.samplerate = sample_rate; @@ -187,14 +187,14 @@ static int init(int rate, int channels, int format, int flags) { ao_data.bps = sample_rate * bytes_per_frame; ao_data.buffersize=131072; ao_data.outburst = ao_data.buffersize/16; - + ao_config = alNewConfig(); - + if (!ao_config) { mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SGI] init: %s\n", alGetErrorString(oserror())); return 0; } - + if(alSetChannels(ao_config, channels) < 0 || alSetWidth(ao_config, smpwidth) < 0 || alSetSampFmt(ao_config, smpfmt) < 0 || @@ -203,17 +203,17 @@ static int init(int rate, int channels, int format, int flags) { mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SGI] init: %s\n", alGetErrorString(oserror())); return 0; } - + ao_port = alOpenPort("mplayer", "w", ao_config); - + if (!ao_port) { mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SGI] init: Unable to open audio channel: %s\n", alGetErrorString(oserror())); return 0; } - + // printf("ao_sgi, init: port %d config %d\n", ao_port, ao_config); queue_size = alGetQueueSize(ao_config); - return 1; + return 1; } @@ -231,26 +231,26 @@ static void uninit(int immed) { if (ao_port) { if (!immed) - while(alGetFilled(ao_port) > 0) sginap(1); + while(alGetFilled(ao_port) > 0) sginap(1); alClosePort(ao_port); ao_port = NULL; } - + } // stop playing and empty buffers (for seeking/pause) static void reset(void) { - + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO SGI] reset: ...\n"); - + alDiscardFrames(ao_port, queue_size); } // stop playing, keep buffers (for pause) static void audio_pause(void) { - + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO SGI] audio_pause: ...\n"); - + } // resume playing, after audio_pause() @@ -262,12 +262,12 @@ static void audio_resume(void) { // return: how many bytes can be played without blocking static int get_space(void) { - + // printf("ao_sgi, get_space: (ao_outburst %d)\n", ao_data.outburst); // printf("ao_sgi, get_space: alGetFillable [%d] \n", alGetFillable(ao_port)); - + return alGetFillable(ao_port) * bytes_per_frame; - + } @@ -275,7 +275,7 @@ static int get_space(void) { // it should round it down to outburst*n // return: number of bytes played static int play(void* data, int len, int flags) { - + /* Always process data in quadword-aligned chunks (64-bits). */ const int plen = len / (sizeof(uint64_t) * bytes_per_frame); const int framecount = plen * sizeof(uint64_t); @@ -294,22 +294,16 @@ static int play(void* data, int len, int flags) { alWriteFrames(ao_port, data, framecount); return framecount * bytes_per_frame; - + } // return: delay in seconds between first and last sample in buffer static float get_delay(void){ - + // printf("ao_sgi, get_delay: (ao_buffersize %d)\n", ao_buffersize); - + // return (float)queue_size/((float)sample_rate); const int outstanding = alGetFilled(ao_port); return (float)((outstanding < 0) ? queue_size : outstanding) / ((float)sample_rate); } - - - - - - -- cgit v1.2.3