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_alsa.c | 48 ++++++++++++++++----------------- libao2/ao_alsa5.c | 16 +++++------ libao2/ao_arts.c | 1 - libao2/ao_coreaudio.c | 28 +++++++++---------- libao2/ao_dsound.c | 74 +++++++++++++++++++++++++-------------------------- libao2/ao_dxr2.c | 9 +++---- libao2/ao_esd.c | 24 ++++++++--------- libao2/ao_ivtv.c | 10 +++---- libao2/ao_jack.c | 3 +-- libao2/ao_mpegpes.c | 4 +-- libao2/ao_nas.c | 12 ++++----- libao2/ao_null.c | 6 ++--- libao2/ao_openal.c | 3 +-- libao2/ao_oss.c | 18 ++++++------- libao2/ao_pcm.c | 22 ++++++--------- libao2/ao_sdl.c | 28 ++++++++----------- libao2/ao_sgi.c | 68 +++++++++++++++++++++------------------------- libao2/ao_sun.c | 25 +++++++++-------- libao2/ao_v4l2.c | 10 +++---- libao2/ao_win32.c | 2 +- libao2/audio_out.c | 1 - libao2/audio_out.h | 4 +-- 22 files changed, 196 insertions(+), 220 deletions(-) (limited to 'libao2') diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index c95aed4cf7..4c3629b8c9 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -57,7 +57,7 @@ #include "audio_out_internal.h" #include "libaf/af_format.h" -static const ao_info_t info = +static const ao_info_t info = { "ALSA-0.9.x-1.x audio output", "alsa", @@ -73,7 +73,7 @@ static snd_pcm_hw_params_t *alsa_hwparams; static snd_pcm_sw_params_t *alsa_swparams; /* 16 sets buffersize to 16 * chunksize is as default 1024 - * which seems to be good avarge for most situations + * which seems to be good avarge for most situations * so buffersize is 16384 frames by default */ static int alsa_fragcount = 16; static snd_pcm_uframes_t chunk_size = 1024; @@ -157,7 +157,7 @@ static int control(int cmd, void *arg) //allocate simple id snd_mixer_selem_id_alloca(&sid); - + //sets simple-mixer index and name snd_mixer_selem_id_set_index(sid, mix_index); snd_mixer_selem_id_set_name(sid, mix_name); @@ -173,7 +173,7 @@ static int control(int cmd, void *arg) } if ((err = snd_mixer_attach(handle, card)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Mixer attach %s error: %s\n", + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Mixer attach %s error: %s\n", card, snd_strerror(err)); snd_mixer_close(handle); return CONTROL_ERROR; @@ -208,7 +208,7 @@ static int control(int cmd, void *arg) //setting channels if ((err = snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT, set_vol)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Error setting left channel, %s\n", + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Error setting left channel, %s\n", snd_strerror(err)); return CONTROL_ERROR; } @@ -217,11 +217,11 @@ static int control(int cmd, void *arg) set_vol = vol->right / f_multi + pmin + 0.5; if ((err = snd_mixer_selem_set_playback_volume(elem, SND_MIXER_SCHN_FRONT_RIGHT, set_vol)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Error setting right channel, %s\n", + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Error setting right channel, %s\n", snd_strerror(err)); return CONTROL_ERROR; } - mp_msg(MSGT_AO,MSGL_DBG2,"right=%li, pmin=%li, pmax=%li, mult=%f\n", + mp_msg(MSGT_AO,MSGL_DBG2,"right=%li, pmin=%li, pmax=%li, mult=%f\n", set_vol, pmin, pmax, f_multi); if (snd_mixer_selem_has_playback_switch(elem)) { @@ -246,7 +246,7 @@ static int control(int cmd, void *arg) snd_mixer_close(handle); return CONTROL_OK; } - + } //end switch return CONTROL_UNKNOWN; } @@ -359,7 +359,7 @@ static int init(int rate_hz, int channels, int format, int flags) prepause_frames = 0; snd_lib_error_set_handler(alsa_error_handler); - + ao_data.samplerate = rate_hz; ao_data.format = format; ao_data.channels = channels; @@ -419,7 +419,7 @@ static int init(int rate_hz, int channels, int format, int flags) alsa_format = SND_PCM_FORMAT_MPEG; //? default should be -1 break; } - + //subdevice parsing // set defaults block = 1; @@ -547,11 +547,11 @@ static int init(int rate_hz, int channels, int format, int flags) snd_strerror(err)); return 0; } - + err = snd_pcm_hw_params_set_access(alsa_handler, alsa_hwparams, SND_PCM_ACCESS_RW_INTERLEAVED); if (err < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set access type: %s\n", + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set access type: %s\n", snd_strerror(err)); return 0; } @@ -595,8 +595,8 @@ static int init(int rate_hz, int channels, int format, int flags) } #endif - if ((err = snd_pcm_hw_params_set_rate_near(alsa_handler, alsa_hwparams, - &ao_data.samplerate, NULL)) < 0) + if ((err = snd_pcm_hw_params_set_rate_near(alsa_handler, alsa_hwparams, + &ao_data.samplerate, NULL)) < 0) { mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set samplerate-2: %s\n", snd_strerror(err)); @@ -612,7 +612,7 @@ static int init(int rate_hz, int channels, int format, int flags) int alsa_buffer_time = 500000; /* original 60 */ int alsa_period_time; alsa_period_time = alsa_buffer_time/4; - if ((err = snd_pcm_hw_params_set_buffer_time_near(alsa_handler, alsa_hwparams, + if ((err = snd_pcm_hw_params_set_buffer_time_near(alsa_handler, alsa_hwparams, &alsa_buffer_time, NULL)) < 0) { mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set buffer time near: %s\n", @@ -621,7 +621,7 @@ static int init(int rate_hz, int channels, int format, int flags) } else alsa_buffer_time = err; - if ((err = snd_pcm_hw_params_set_period_time_near(alsa_handler, alsa_hwparams, + if ((err = snd_pcm_hw_params_set_period_time_near(alsa_handler, alsa_hwparams, &alsa_period_time, NULL)) < 0) /* original: alsa_buffer_time/ao_data.bps */ { @@ -631,13 +631,13 @@ static int init(int rate_hz, int channels, int format, int flags) } mp_tmsg(MSGT_AO,MSGL_INFO,"[AO_ALSA] buffer_time: %d, period_time :%d\n", alsa_buffer_time, err); - } + } #endif//end SET_BUFFERTIME #ifdef SET_CHUNKSIZE { //set chunksize - if ((err = snd_pcm_hw_params_set_period_size_near(alsa_handler, alsa_hwparams, + if ((err = snd_pcm_hw_params_set_period_size_near(alsa_handler, alsa_hwparams, &chunk_size, NULL)) < 0) { mp_tmsg(MSGT_AO,MSGL_ERR,"[AO ALSA] Unable to set period size(%ld): %s\n", @@ -649,7 +649,7 @@ static int init(int rate_hz, int channels, int format, int flags) } if ((err = snd_pcm_hw_params_set_periods_near(alsa_handler, alsa_hwparams, &alsa_fragcount, NULL)) < 0) { - mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set periods: %s\n", + mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Unable to set periods: %s\n", snd_strerror(err)); return 0; } @@ -890,15 +890,15 @@ static int get_space(void) { snd_pcm_status_t *status; int ret; - + snd_pcm_status_alloca(&status); - + if ((ret = snd_pcm_status(alsa_handler, status)) < 0) { mp_tmsg(MSGT_AO,MSGL_ERR,"[AO_ALSA] Cannot get pcm status: %s\n", snd_strerror(ret)); return 0; } - + unsigned space = snd_pcm_status_get_avail(status) * bytes_per_sample; if (space > ao_data.buffersize) // Buffer underrun? space = ao_data.buffersize; @@ -910,10 +910,10 @@ static float get_delay(void) { if (alsa_handler) { snd_pcm_sframes_t delay; - + if (snd_pcm_delay(alsa_handler, &delay) < 0) return 0; - + if (delay < 0) { /* underrun - move the application pointer forward to catch up */ #if SND_LIB_VERSION >= 0x000901 /* snd_pcm_forward() exists since 0.9.0rc8 */ diff --git a/libao2/ao_alsa5.c b/libao2/ao_alsa5.c index bca4e93ed8..b2dc1efd3a 100644 --- a/libao2/ao_alsa5.c +++ b/libao2/ao_alsa5.c @@ -32,7 +32,7 @@ #include "mp_msg.h" #include "help_mp.h" -static const ao_info_t info = +static const ao_info_t info = { "ALSA-0.5.x audio output", "alsa5", @@ -117,7 +117,7 @@ static int init(int rate_hz, int channels, int format, int flags) alsa_format.format = SND_PCM_SFMT_MPEG; break; } - + switch(alsa_format.format) { case SND_PCM_SFMT_S16_LE: @@ -230,7 +230,7 @@ static int init(int rate_hz, int channels, int format, int flags) setup.format = alsa_format; setup.buf.stream.queue_size = ao_data.buffersize; setup.msbits_per_sample = ao_data.bps; - + if ((err = snd_pcm_channel_setup(alsa_handler, &setup)) < 0) { mp_tmsg(MSGT_AO, MSGL_ERR, "[AO ALSA5] alsa-init: error setting up channel: %s\n", snd_strerror(err)); @@ -333,10 +333,10 @@ static void audio_resume(void) static int play(void* data, int len, int flags) { int got_len; - + if (!len) return 0; - + if ((got_len = snd_pcm_write(alsa_handler, data, len)) < 0) { if (got_len == -EPIPE) /* underrun? */ @@ -365,7 +365,7 @@ static int play(void* data, int len, int flags) static int get_space(void) { snd_pcm_channel_status_t ch_stat; - + ch_stat.channel = SND_PCM_CHANNEL_PLAYBACK; if (snd_pcm_channel_status(alsa_handler, &ch_stat) < 0) @@ -378,9 +378,9 @@ static int get_space(void) static float get_delay(void) { snd_pcm_channel_status_t ch_stat; - + ch_stat.channel = SND_PCM_CHANNEL_PLAYBACK; - + if (snd_pcm_channel_status(alsa_handler, &ch_stat) < 0) return (float)ao_data.buffersize/(float)ao_data.bps; /* error occurred */ else diff --git a/libao2/ao_arts.c b/libao2/ao_arts.c index 1d1638ba2d..5e55d6f6b7 100644 --- a/libao2/ao_arts.c +++ b/libao2/ao_arts.c @@ -147,4 +147,3 @@ static float get_delay(void) return ((float) (ao_data.buffersize - arts_stream_get(stream, ARTS_P_BUFFER_SPACE))) / ((float) ao_data.bps); } - diff --git a/libao2/ao_coreaudio.c b/libao2/ao_coreaudio.c index 3ef6d3367f..76cb9174be 100644 --- a/libao2/ao_coreaudio.c +++ b/libao2/ao_coreaudio.c @@ -174,7 +174,7 @@ Float32 vol; ao->b_muted = 0; return CONTROL_TRUE; } - + vol=(control_vol->left+control_vol->right)*4.0/200.0; err = AudioUnitSetParameter(ao->theOutputUnit, kHALOutputParam_Volume, kAudioUnitScope_Global, 0, vol, 0); if(err==0) { @@ -189,7 +189,7 @@ Float32 vol; default: return CONTROL_FALSE; } - + } @@ -237,8 +237,8 @@ static OSStatus DeviceListener( AudioDeviceID inDevice, static int init(int rate,int channels,int format,int flags) { AudioStreamBasicDescription inDesc; -ComponentDescription desc; -Component comp; +ComponentDescription desc; +Component comp; AURenderCallbackStruct renderCallback; OSStatus err; UInt32 size, maxFrames, i_param_size; @@ -396,20 +396,20 @@ int b_alive; desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; - + comp = FindNextComponent(NULL, &desc); //Finds an component that meets the desc spec's if (comp == NULL) { ao_msg(MSGT_AO, MSGL_WARN, "Unable to find Output Unit component\n"); goto err_out; } - + err = OpenAComponent(comp, &(ao->theOutputUnit)); //gains access to the services provided by the component if (err) { ao_msg(MSGT_AO, MSGL_WARN, "Unable to open Output Unit component: [%4.4s]\n", (char *)&err); goto err_out; } - // Initialize AudioUnit + // Initialize AudioUnit err = AudioUnitInitialize(ao->theOutputUnit); if (err) { ao_msg(MSGT_AO, MSGL_WARN, "Unable to initialize Output Unit component: [%4.4s]\n", (char *)&err); @@ -426,7 +426,7 @@ int b_alive; size = sizeof(UInt32); err = AudioUnitGetProperty(ao->theOutputUnit, kAudioDevicePropertyBufferSize, kAudioUnitScope_Input, 0, &maxFrames, &size); - + if (err) { ao_msg(MSGT_AO,MSGL_WARN, "AudioUnitGetProperty returned [%4.4s] when getting kAudioDevicePropertyBufferSize\n", (char *)&err); @@ -434,7 +434,7 @@ int b_alive; } ao->chunk_size = maxFrames;//*inDesc.mBytesPerFrame; - + ao_data.samplerate = inDesc.mSampleRate; ao_data.channels = inDesc.mChannelsPerFrame; ao_data.bps = ao_data.samplerate * inDesc.mBytesPerFrame; @@ -444,7 +444,7 @@ int b_alive; ao->num_chunks = (ao_data.bps+ao->chunk_size-1)/ao->chunk_size; ao->buffer_len = ao->num_chunks * ao->chunk_size; ao->buffer = av_fifo_alloc(ao->buffer_len); - + ao_msg(MSGT_AO,MSGL_V, "using %5d chunks of %d bytes (buffer len %d bytes)\n", (int)ao->num_chunks, (int)ao->chunk_size, (int)ao->buffer_len); renderCallback.inputProc = theRenderProc; @@ -456,7 +456,7 @@ int b_alive; } reset(); - + return CONTROL_OK; err_out2: @@ -467,7 +467,7 @@ err_out: av_fifo_free(ao->buffer); free(ao); ao = NULL; - return CONTROL_FALSE; + return CONTROL_FALSE; } /***************************************************************************** @@ -734,7 +734,7 @@ err_out: av_fifo_free(ao->buffer); free(ao); ao = NULL; - return CONTROL_FALSE; + return CONTROL_FALSE; } /***************************************************************************** @@ -943,7 +943,7 @@ static OSStatus RenderCallbackSPDIF( AudioDeviceID inDevice, static int play(void* output_samples,int num_bytes,int flags) -{ +{ int wrote, b_digital; // Check whether we need to reset the digital output stream. diff --git a/libao2/ao_dsound.c b/libao2/ao_dsound.c index 729084b145..4197c30e27 100644 --- a/libao2/ao_dsound.c +++ b/libao2/ao_dsound.c @@ -113,17 +113,17 @@ static const int channel_mask[] = { }; static HINSTANCE hdsound_dll = NULL; ///handle to the dll -static LPDIRECTSOUND hds = NULL; ///direct sound object +static LPDIRECTSOUND hds = NULL; ///direct sound object static LPDIRECTSOUNDBUFFER hdspribuf = NULL; ///primary direct sound buffer static LPDIRECTSOUNDBUFFER hdsbuf = NULL; ///secondary direct sound buffer (stream buffer) -static int buffer_size = 0; ///size in bytes of the direct sound buffer +static int buffer_size = 0; ///size in bytes of the direct sound buffer static int write_offset = 0; ///offset of the write cursor in the direct sound buffer static int min_free_space = 0; ///if the free space is below this value get_space() will return 0 ///there will always be at least this amout of free space to prevent ///get_space() from returning wrong values when buffer is 100% full. ///will be replaced with nBlockAlign in init() static int device_num = 0; ///wanted device number -static GUID device; ///guid of the device +static GUID device; ///guid of the device /***************************************************************************************/ @@ -221,17 +221,17 @@ static int InitDirectSound(void) // initialize directsound HRESULT (WINAPI *OurDirectSoundCreate)(LPGUID, LPDIRECTSOUND *, LPUNKNOWN); - HRESULT (WINAPI *OurDirectSoundEnumerate)(LPDSENUMCALLBACKA, LPVOID); + HRESULT (WINAPI *OurDirectSoundEnumerate)(LPDSENUMCALLBACKA, LPVOID); int device_index=0; opt_t subopts[] = { {"device", OPT_ARG_INT, &device_num,NULL}, {NULL} - }; + }; if (subopt_parse(ao_subdevice, subopts) != 0) { print_help(); return 0; } - + hdsound_dll = LoadLibrary("DSOUND.DLL"); if (hdsound_dll == NULL) { mp_msg(MSGT_AO, MSGL_ERR, "ao_dsound: cannot load DSOUND.DLL\n"); @@ -245,7 +245,7 @@ static int InitDirectSound(void) FreeLibrary(hdsound_dll); return 0; } - + // Enumerate all directsound devices mp_msg(MSGT_AO, MSGL_V,"ao_dsound: Output Devices:\n"); OurDirectSoundEnumerate(DirectSoundEnum,&device_index); @@ -310,22 +310,22 @@ static void DestroyBuffer(void) static int write_buffer(unsigned char *data, int len) { HRESULT res; - LPVOID lpvPtr1; - DWORD dwBytes1; - LPVOID lpvPtr2; - DWORD dwBytes2; - + LPVOID lpvPtr1; + DWORD dwBytes1; + LPVOID lpvPtr2; + DWORD dwBytes2; + // Lock the buffer - res = IDirectSoundBuffer_Lock(hdsbuf,write_offset, len, &lpvPtr1, &dwBytes1, &lpvPtr2, &dwBytes2, 0); - // If the buffer was lost, restore and retry lock. - if (DSERR_BUFFERLOST == res) - { + res = IDirectSoundBuffer_Lock(hdsbuf,write_offset, len, &lpvPtr1, &dwBytes1, &lpvPtr2, &dwBytes2, 0); + // If the buffer was lost, restore and retry lock. + if (DSERR_BUFFERLOST == res) + { IDirectSoundBuffer_Restore(hdsbuf); res = IDirectSoundBuffer_Lock(hdsbuf,write_offset, len, &lpvPtr1, &dwBytes1, &lpvPtr2, &dwBytes2, 0); } - - - if (SUCCEEDED(res)) + + + if (SUCCEEDED(res)) { if( (ao_data.channels == 6) && (ao_data.format!=AF_FORMAT_AC3) ) { // reorder channels while writing to pointers. @@ -354,27 +354,27 @@ static int write_buffer(unsigned char *data, int len) write_offset+=dwBytes1+dwBytes2; if(write_offset>=buffer_size)write_offset=dwBytes2; } else { - // Write to pointers without reordering. + // Write to pointers without reordering. fast_memcpy(lpvPtr1,data,dwBytes1); if (NULL != lpvPtr2 )fast_memcpy(lpvPtr2,data+dwBytes1,dwBytes2); write_offset+=dwBytes1+dwBytes2; if(write_offset>=buffer_size)write_offset=dwBytes2; } - - // Release the data back to DirectSound. + + // Release the data back to DirectSound. res = IDirectSoundBuffer_Unlock(hdsbuf,lpvPtr1,dwBytes1,lpvPtr2,dwBytes2); - if (SUCCEEDED(res)) - { - // Success. + if (SUCCEEDED(res)) + { + // Success. DWORD status; IDirectSoundBuffer_GetStatus(hdsbuf, &status); if (!(status & DSBSTATUS_PLAYING)){ res = IDirectSoundBuffer_Play(hdsbuf, 0, 0, DSBPLAY_LOOPING); } - return dwBytes1+dwBytes2; - } - } - // Lock, Unlock, or Restore failed. + return dwBytes1+dwBytes2; + } + } + // Lock, Unlock, or Restore failed. return 0; } @@ -408,7 +408,7 @@ static int control(int cmd, void *arg) return -1; } -/** +/** \brief setup sound device \param rate samplerate \param channels number of channels @@ -436,7 +436,7 @@ static int init(int rate, int channels, int format, int flags) default: mp_msg(MSGT_AO, MSGL_V,"ao_dsound: format %s not supported defaulting to Signed 16-bit Little-Endian\n",af_fmt2str_short(format)); format=AF_FORMAT_S16_LE; - } + } //fill global ao_data ao_data.channels = channels; ao_data.samplerate = rate; @@ -493,7 +493,7 @@ static int init(int rate, int channels, int format, int flags) ao_data.outburst = wformat.Format.nBlockAlign * 512; // create primary buffer and set its format - + res = IDirectSound_CreateSoundBuffer( hds, &dsbpridesc, &hdspribuf, NULL ); if ( res != DS_OK ) { UninitDirectSound(); @@ -553,7 +553,7 @@ static void audio_resume(void) IDirectSoundBuffer_Play(hdsbuf, 0, 0, DSBPLAY_LOOPING); } -/** +/** \brief close audio device \param immed stop playback immediately */ @@ -579,7 +579,7 @@ static int get_space(void) int space; DWORD play_offset; IDirectSoundBuffer_GetCurrentPosition(hdsbuf,&play_offset,NULL); - space=buffer_size-(write_offset-play_offset); + space=buffer_size-(write_offset-play_offset); // | | <-- const --> | | | // buffer start play_cursor write_cursor write_offset buffer end // play_cursor is the actual postion of the play cursor @@ -601,10 +601,10 @@ static int play(void* data, int len, int flags) { DWORD play_offset; int space; - + // make sure we have enough space to write data IDirectSoundBuffer_GetCurrentPosition(hdsbuf,&play_offset,NULL); - space=buffer_size-(write_offset-play_offset); + space=buffer_size-(write_offset-play_offset); if(space > buffer_size)space -= buffer_size; // write_offset < play_offset if(space < len) len = space; @@ -622,7 +622,7 @@ static float get_delay(void) DWORD play_offset; int space; IDirectSoundBuffer_GetCurrentPosition(hdsbuf,&play_offset,NULL); - space=play_offset-write_offset; + space=play_offset-write_offset; if(space <= 0)space += buffer_size; return (float)(buffer_size - space) / (float)ao_data.bps; } diff --git a/libao2/ao_dxr2.c b/libao2/ao_dxr2.c index 51cd1a0d01..e8aa65aab5 100644 --- a/libao2/ao_dxr2.c +++ b/libao2/ao_dxr2.c @@ -67,7 +67,7 @@ static int control(int cmd,void *arg){ ao_control_vol_t* vol = (ao_control_vol_t*)arg; // We need this trick because the volume stepping is often too small diff = ((vol->left+vol->right) / 2 - (volume*19.0/100.0)) * 19.0 / 100.0; - v.arg = volume + (diff > 0 ? ceil(diff) : floor(diff)); + v.arg = volume + (diff > 0 ? ceil(diff) : floor(diff)); if(v.arg > 19) v.arg = 19; if(v.arg < 0) v.arg = 0; if(v.arg != volume) { @@ -95,7 +95,7 @@ static int init(int rate,int channels,int format,int flags){ return 0; last_freq_id = -1; - + ao_data.outburst=2048; ao_data.samplerate=rate; ao_data.channels=channels; @@ -178,11 +178,11 @@ static int get_space(void){ static void dxr2_send_lpcm_packet(unsigned char* data,int len,int id,unsigned int timestamp,int freq_id) { int write_dxr2(const unsigned char *data, int len); - + if(dxr2_fd < 0) { mp_msg(MSGT_AO,MSGL_ERR,"DXR2 fd is not valid\n"); return; - } + } if(last_freq_id != freq_id) { ioctl(dxr2_fd, DXR2_IOC_SET_AUDIO_SAMPLE_FREQUENCY, &freq_id); @@ -220,4 +220,3 @@ static float get_delay(void){ return 0.0; } - diff --git a/libao2/ao_esd.c b/libao2/ao_esd.c index 7a9ad96170..28a0009b80 100644 --- a/libao2/ao_esd.c +++ b/libao2/ao_esd.c @@ -122,7 +122,7 @@ static int control(int cmd, void *arg) vol_cache_time = now; } esd_free_all_info(esd_i); - + return CONTROL_OK; case AOCONTROL_SET_VOLUME: @@ -236,19 +236,19 @@ static int init(int rate_hz, int channels, int format, int flags) #ifdef CONFIG_ESD_LATENCY esd_latency = esd_get_latency(esd_fd); #else - esd_latency = ((channels == 1 ? 2 : 1) * ESD_DEFAULT_RATE * + esd_latency = ((channels == 1 ? 2 : 1) * ESD_DEFAULT_RATE * (ESD_BUF_SIZE + 64 * (4.0f / bytes_per_sample)) - ) / rate_hz; - esd_latency += ESD_BUF_SIZE * 2; + ) / rate_hz; + esd_latency += ESD_BUF_SIZE * 2; #endif if(esd_latency > 0) { lag_serv = (esd_latency * 4.0f) / (bytes_per_sample * rate_hz); lag_seconds = lag_net + lag_serv; audio_delay += lag_seconds; - mp_tmsg(MSGT_AO, MSGL_INFO,"[AO ESD] latency: [server: %0.2fs, net: %0.2fs] (adjust %0.2fs)\n", + mp_tmsg(MSGT_AO, MSGL_INFO,"[AO ESD] latency: [server: %0.2fs, net: %0.2fs] (adjust %0.2fs)\n", lag_serv, lag_net, lag_seconds); } - + esd_play_fd = esd_play_stream_fallback(esd_fmt, rate_hz, server, ESD_CLIENT_NAME); if (esd_play_fd < 0) { @@ -333,7 +333,7 @@ static int play(void* data, int len, int flags) */ n = write(esd_play_fd, (char*)data + offs, ESD_BUF_SIZE); if ( n < 0 ) { - if ( errno != EAGAIN ) + if ( errno != EAGAIN ) dprintf("esd play: write failed: %s\n", strerror(errno)); break; } else if ( n != ESD_BUF_SIZE ) { @@ -343,13 +343,13 @@ static int play(void* data, int len, int flags) nwritten += n; } #endif - + if (nwritten > 0) { if (!esd_play_start.tv_sec) gettimeofday(&esd_play_start, NULL); nsamples = nwritten / esd_bytes_per_sample; esd_samples_written += nsamples; - + dprintf("esd play: %d %lu\n", nsamples, esd_samples_written); } else { dprintf("esd play: blocked / %lu\n", esd_samples_written); @@ -395,7 +395,7 @@ static void reset(void) { #ifdef __svr4__ /* throw away data buffered in the esd connection */ - if (ioctl(esd_play_fd, I_FLUSH, FLUSHW)) + if (ioctl(esd_play_fd, I_FLUSH, FLUSHW)) perror("I_FLUSH"); #endif } @@ -411,7 +411,7 @@ static int get_space(void) float current_delay; int space; - /* + /* * Don't buffer too much data in the esd daemon. * * If we send too much, esd will block in write()s to the sound @@ -461,7 +461,7 @@ static float get_delay(void) gettimeofday(&now, NULL); play_time = now.tv_sec - esd_play_start.tv_sec; play_time += (now.tv_usec - esd_play_start.tv_usec) / 1000000.; - + /* dprintf("esd delay: %f %f\n", play_time, buffered_samples_time); */ if (play_time > buffered_samples_time) { diff --git a/libao2/ao_ivtv.c b/libao2/ao_ivtv.c index 22e2f49a74..6b6bb8816c 100644 --- a/libao2/ao_ivtv.c +++ b/libao2/ao_ivtv.c @@ -41,7 +41,7 @@ static int freq = 0; -static const ao_info_t info = +static const ao_info_t info = { "IVTV MPEG Audio Decoder output", "ivtv", @@ -73,7 +73,7 @@ init (int rate, int channels, int format, int flags) "AO: [ivtv] can only handle MPEG audio streams.\n"); return 0; } - + ao_data.outburst = 2048; ao_data.samplerate = rate; ao_data.channels = channels; @@ -132,11 +132,11 @@ get_space (void) x = (float) (vo_pts - ao_data.pts) / 90000.0; if (x <= 0) return 0; - + y = freq * 4 * x; y /= ao_data.outburst; y *= ao_data.outburst; - + if (y > 32000) y = 32000; @@ -148,7 +148,7 @@ static int play (void *data, int len, int flags) { int ivtv_write (const unsigned char *data, int len); - + if (ao_data.format != AF_FORMAT_MPEG2) return 0; diff --git a/libao2/ao_jack.c b/libao2/ao_jack.c index 8ee5550602..14bb1c90dd 100644 --- a/libao2/ao_jack.c +++ b/libao2/ao_jack.c @@ -40,7 +40,7 @@ #include -static const ao_info_t info = +static const ao_info_t info = { "JACK audio output", "jack", @@ -360,4 +360,3 @@ static float get_delay(void) { } return (float)buffered / (float)ao_data.bps + in_jack; } - diff --git a/libao2/ao_mpegpes.c b/libao2/ao_mpegpes.c index e8c0f01d14..096f7bade5 100644 --- a/libao2/ao_mpegpes.c +++ b/libao2/ao_mpegpes.c @@ -63,7 +63,7 @@ int vo_mpegpes_fd2 = -1; #include -static const ao_info_t info = +static const ao_info_t info = { #ifdef CONFIG_DVB "DVB audio output", @@ -194,7 +194,7 @@ static int preinit(const char *arg) #ifdef CONFIG_DVB if(!ao_file) return init_device(card); -#else +#else if(!ao_file) return vo_mpegpes_fd; //video fd #endif diff --git a/libao2/ao_nas.c b/libao2/ao_nas.c index e5e675be3f..fb49c5e60e 100644 --- a/libao2/ao_nas.c +++ b/libao2/ao_nas.c @@ -119,7 +119,7 @@ static const char* nas_state(unsigned int state) { return nas_states[state]; } -static const ao_info_t info = +static const ao_info_t info = { "NAS audio output", "nas", @@ -201,7 +201,7 @@ static int nas_readBuffer(struct ao_nas_data *nas_data, unsigned int num) * Now write the new buffer to the network. */ AuWriteElement(nas_data->aud, nas_data->flow, 0, num, nas_data->server_buffer, AuFalse, &as); - if (as != AuSuccess) + if (as != AuSuccess) nas_print_error(nas_data->aud, "nas_readBuffer(): AuWriteElement", as); return num; @@ -229,7 +229,7 @@ static int nas_empty_event_queue(struct ao_nas_data *nas_data) { AuEvent ev; int result = 0; - + while (AuScanForTypedEvent(nas_data->aud, AuEventsQueuedAfterFlush, AuTrue, AuEventTypeElementNotify, &ev)) { AuDispatchEvent(nas_data->aud, &ev); @@ -462,7 +462,7 @@ static int init(int rate,int channels,int format,int flags) mp_msg(MSGT_AO, MSGL_V, "ao_nas: init(): Using audioserver %s\n", server); nas_data->aud = AuOpenServer(server, 0, NULL, 0, NULL, NULL); - if (!nas_data->aud) { + if (!nas_data->aud) { mp_msg(MSGT_AO, MSGL_ERR, "ao_nas: init(): Can't open nas audio server -> nosound\n"); return 0; } @@ -571,7 +571,7 @@ static void audio_resume(void) static int get_space(void) { int result; - + mp_msg(MSGT_AO, MSGL_DBG3, "ao_nas: get_space()\n"); pthread_mutex_lock(&nas_data->buffer_mutex); @@ -631,7 +631,7 @@ static int play(void* data,int len,int flags) static float get_delay(void) { float result; - + mp_msg(MSGT_AO, MSGL_DBG3, "ao_nas: get_delay()\n"); pthread_mutex_lock(&nas_data->buffer_mutex); diff --git a/libao2/ao_null.c b/libao2/ao_null.c index 20b715fb96..17b3bc7e4e 100644 --- a/libao2/ao_null.c +++ b/libao2/ao_null.c @@ -27,7 +27,7 @@ #include "audio_out.h" #include "audio_out_internal.h" -static const ao_info_t info = +static const ao_info_t info = { "Null audio output", "null", @@ -41,14 +41,14 @@ struct timeval last_tv; int buffer; static void drain(void){ - + struct timeval now_tv; int temp, temp2; gettimeofday(&now_tv, 0); temp = now_tv.tv_sec - last_tv.tv_sec; temp *= ao_data.bps; - + temp2 = now_tv.tv_usec - last_tv.tv_usec; temp2 /= 1000; temp2 *= ao_data.bps; diff --git a/libao2/ao_openal.c b/libao2/ao_openal.c index c80c49b27a..b00a77364a 100644 --- a/libao2/ao_openal.c +++ b/libao2/ao_openal.c @@ -42,7 +42,7 @@ #include "osdep/timer.h" #include "subopt-helper.h" -static const ao_info_t info = +static const ao_info_t info = { "OpenAL audio output", "openal", @@ -251,4 +251,3 @@ static float get_delay(void) { alGetSourcei(sources[0], AL_BUFFERS_QUEUED, &queued); return queued * CHUNK_SIZE / 2 / (float)ao_data.samplerate; } - diff --git a/libao2/ao_oss.c b/libao2/ao_oss.c index c331f8331b..c16d55c8df 100644 --- a/libao2/ao_oss.c +++ b/libao2/ao_oss.c @@ -48,7 +48,7 @@ #include "audio_out.h" #include "audio_out_internal.h" -static const ao_info_t info = +static const ao_info_t info = { "OSS/ioctl audio output", "oss", @@ -228,7 +228,7 @@ static int control(int cmd,void *arg){ if(ao_data.format == AF_FORMAT_AC3) return CONTROL_TRUE; - + if ((fd = open(oss_mixer_device, O_RDONLY)) > 0) { ioctl(fd, SOUND_MIXER_READ_DEVMASK, &devs); @@ -289,17 +289,17 @@ static int init(int rate,int channels,int format,int flags){ oss_mixer_device=mdev; else oss_mixer_device=PATH_DEV_MIXER; - + if(mchan){ int fd, devs, i; - + if ((fd = open(oss_mixer_device, O_RDONLY)) == -1){ mp_tmsg(MSGT_AO,MSGL_ERR,"[AO OSS] audio_setup: Can't open mixer device %s: %s\n", oss_mixer_device, strerror(errno)); }else{ ioctl(fd, SOUND_MIXER_READ_DEVMASK, &devs); close(fd); - + for (i=0; i2 channels, in case some drivers don't have it diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c index 8940107eec..8be3bdabb5 100644 --- a/libao2/ao_pcm.c +++ b/libao2/ao_pcm.c @@ -35,7 +35,7 @@ #include "help_mp.h" -static const ao_info_t info = +static const ao_info_t info = { "RAW PCM/WAVE file writer audio output", "pcm", @@ -149,13 +149,13 @@ static int init(int rate,int channels,int format,int flags){ wavhdr.bytes_per_second = le2me_32(ao_data.bps); wavhdr.bits = le2me_16(bits); wavhdr.block_align = le2me_16(ao_data.channels * (bits / 8)); - + wavhdr.data = le2me_32(WAV_ID_DATA); wavhdr.data_length=le2me_32(0x7ffff000); wavhdr.file_length = wavhdr.data_length + sizeof(wavhdr) - 8; - mp_tmsg(MSGT_AO, MSGL_INFO, "[AO PCM] File: %s (%s)\nPCM: Samplerate: %iHz Channels: %s Format %s\n", ao_outputfilename, - (ao_pcm_waveheader?"WAVE":"RAW PCM"), rate, + mp_tmsg(MSGT_AO, MSGL_INFO, "[AO PCM] File: %s (%s)\nPCM: Samplerate: %iHz Channels: %s Format %s\n", ao_outputfilename, + (ao_pcm_waveheader?"WAVE":"RAW PCM"), rate, (channels > 1) ? "Stereo" : "Mono", af_fmt2str_short(format)); mp_tmsg(MSGT_AO, MSGL_INFO, "[AO PCM] Info: Faster dumping is achieved with -vc null -vo null -ao pcm:fast\n[AO PCM] Info: To write WAVE files use -ao pcm:waveheader (default).\n"); @@ -166,14 +166,14 @@ static int init(int rate,int channels,int format,int flags){ } return 1; } - mp_tmsg(MSGT_AO, MSGL_ERR, "[AO PCM] Failed to open %s for writing!\n", + mp_tmsg(MSGT_AO, MSGL_ERR, "[AO PCM] Failed to open %s for writing!\n", ao_outputfilename); return 0; } // close audio device static void uninit(int immed){ - + if(ao_pcm_waveheader){ /* Rewrite wave header */ if (fseek(fp, 0, SEEK_SET) != 0) mp_msg(MSGT_AO, MSGL_ERR, "Could not seek to start, WAV size headers not updated!\n"); @@ -232,7 +232,7 @@ static int play(void* data,int len,int flags){ buffer[i] = le2me_16(buffer[i]); } } -#endif +#endif if (ao_data.channels == 6 || ao_data.channels == 5) { int frame_size = le2me_16(wavhdr.bits) / 8; @@ -248,7 +248,7 @@ static int play(void* data,int len,int flags){ if(ao_pcm_waveheader) data_length += len; - + return len; } @@ -257,9 +257,3 @@ static float get_delay(void){ return 0.0; } - - - - - - 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; } - - - - - - 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); } - - - - - - diff --git a/libao2/ao_sun.c b/libao2/ao_sun.c index d2da673177..72353bc736 100644 --- a/libao2/ao_sun.c +++ b/libao2/ao_sun.c @@ -49,7 +49,7 @@ #include "mp_msg.h" #include "help_mp.h" -static const ao_info_t info = +static const ao_info_t info = { "Sun audio output", "sun", @@ -142,7 +142,7 @@ static int realtime_samplecounter_available(char *dev) silence = calloc(1, len); if (silence == NULL) goto error; - + if ((fd = open(dev, O_WRONLY)) < 0) goto error; @@ -157,7 +157,7 @@ static int realtime_samplecounter_available(char *dev) mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SUN] rtsc: SETINFO failed.\n"); goto error; } - + if (write(fd, silence, len) != len) { if ( mp_msg_test(MSGT_AO,MSGL_V) ) mp_tmsg(MSGT_AO, MSGL_ERR, "[AO SUN] rtsc: write failed.\n"); @@ -215,7 +215,7 @@ static int realtime_samplecounter_available(char *dev) * sample counter increment from the soundcard driver of less than * 2000 samples, we assume that the driver provides a useable realtime * sample counter in the AUDIO_INFO play.samples field. Timing based - * on sample counts should be much more accurate than counting whole + * on sample counts should be much more accurate than counting whole * 16kbyte chunks. */ if (min_increment < 2000) @@ -225,7 +225,7 @@ static int realtime_samplecounter_available(char *dev) mp_msg(MSGT_AO,MSGL_V,"ao_sun: minimum sample counter increment per 10msec interval: %d\n" "\t%susing sample counter based timing code\n", min_increment, rtsc_ok == RTSC_ENABLED ? "" : "not "); - + error: if (silence != NULL) free(silence); @@ -272,7 +272,7 @@ find_close_samplerate_match(int dev, unsigned sample_rate) if (sr->flags & MIXER_SR_LIMITS) { /* - * HW can playback any rate between + * HW can playback any rate between * sr->samp_rates[0] .. sr->samp_rates[1] */ free(sr); @@ -318,7 +318,7 @@ find_close_samplerate_match(int dev, unsigned sample_rate) for (i = 0; audiocs_rates[i]; i++) { err = abs(audiocs_rates[i] - sample_rate); if (err == 0) { - /* + /* * exact supported sample rate match, no need to * retry something elise */ @@ -361,7 +361,7 @@ find_highest_samplerate(int dev) if (sr->flags & MIXER_SR_LIMITS) { /* - * HW can playback any rate between + * HW can playback any rate between * sr->samp_rates[0] .. sr->samp_rates[1] */ max_rate = sr->samp_rates[1]; @@ -435,7 +435,7 @@ static int control(int cmd,void *arg){ } close( fd ); return CONTROL_OK; - } + } return CONTROL_ERROR; } case AOCONTROL_SET_VOLUME: @@ -466,7 +466,7 @@ static int control(int cmd,void *arg){ ioctl( fd,AUDIO_SETINFO,&info ); close( fd ); return CONTROL_OK; - } + } return CONTROL_ERROR; } } @@ -516,7 +516,7 @@ static int init(int rate,int channels,int format,int flags){ if (pass & 1) { /* - * on some sun audio drivers, 8-bit unsigned LINEAR8 encoding is + * on some sun audio drivers, 8-bit unsigned LINEAR8 encoding is * not supported, but 8-bit signed encoding is. * * Try S8, and if it works, use our own U8->S8 conversion before @@ -539,7 +539,7 @@ static int init(int rate,int channels,int format,int flags){ * supported rates, use the fixed supported rate instead. */ if (!(info.play.sample_rate = - find_close_samplerate_match(audio_fd, rate))) + find_close_samplerate_match(audio_fd, rate))) continue; /* @@ -694,4 +694,3 @@ static float get_delay(void){ return (float)((queued_bursts - info.play.eof) * ao_data.outburst) / (float)byte_per_sec; #endif } - diff --git a/libao2/ao_v4l2.c b/libao2/ao_v4l2.c index c1e0671835..82c53a226a 100644 --- a/libao2/ao_v4l2.c +++ b/libao2/ao_v4l2.c @@ -38,7 +38,7 @@ static int freq = 0; -static const ao_info_t info = +static const ao_info_t info = { "V4L2 MPEG Audio Decoder output", "v4l2", @@ -70,7 +70,7 @@ init (int rate, int channels, int format, int flags) "AO: [v4l2] can only handle MPEG audio streams.\n"); return 0; } - + ao_data.outburst = 2048; ao_data.samplerate = rate; ao_data.channels = channels; @@ -129,11 +129,11 @@ get_space (void) x = (float) (vo_pts - ao_data.pts) / 90000.0; if (x <= 0) return 0; - + y = freq * 4 * x; y /= ao_data.outburst; y *= ao_data.outburst; - + if (y > 32000) y = 32000; @@ -145,7 +145,7 @@ static int play (void *data, int len, int flags) { int v4l2_write (const unsigned char *data, int len); - + if (ao_data.format != AF_FORMAT_MPEG2) return 0; diff --git a/libao2/ao_win32.c b/libao2/ao_win32.c index b2ba0fc573..a0475455ec 100644 --- a/libao2/ao_win32.c +++ b/libao2/ao_win32.c @@ -200,7 +200,7 @@ static int init(int rate,int channels,int format,int flags) } wformat.Format.nAvgBytesPerSec = wformat.Format.nSamplesPerSec * wformat.Format.nBlockAlign; - + //open sound device //WAVE_MAPPER always points to the default wave device on the system result = waveOutOpen(&hWaveOut,WAVE_MAPPER,(WAVEFORMATEX*)&wformat,(DWORD_PTR)waveOutProc,0,CALLBACK_FUNCTION); diff --git a/libao2/audio_out.c b/libao2/audio_out.c index ab40121d76..5ceafff73f 100644 --- a/libao2/audio_out.c +++ b/libao2/audio_out.c @@ -188,4 +188,3 @@ const ao_functions_t* init_best_audio_out(char** ao_list,int use_plugin,int rate } return NULL; } - diff --git a/libao2/audio_out.h b/libao2/audio_out.h index b7f51e0ed8..e483a88422 100644 --- a/libao2/audio_out.h +++ b/libao2/audio_out.h @@ -52,8 +52,8 @@ typedef struct ao_data { int channels; int format; int bps; - int outburst; - int buffersize; + int outburst; + int buffersize; int pts; } ao_data_t; -- cgit v1.2.3