From bf3e0bc1dad8a51e60494388e3559c9bb5f1d7e5 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Thu, 2 Apr 2015 22:16:57 -0700 Subject: ao_wasapi: code formatting and alignment --- audio/out/ao_wasapi.c | 30 +++++++++++++++--------------- audio/out/ao_wasapi_utils.c | 17 ++++++++--------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/audio/out/ao_wasapi.c b/audio/out/ao_wasapi.c index 205a25d03e..c86e7311d7 100644 --- a/audio/out/ao_wasapi.c +++ b/audio/out/ao_wasapi.c @@ -244,10 +244,10 @@ static int init(struct ao *ao) MP_WARN(ao, "Error loading thread priority functions\n"); state->init_done = CreateEventW(NULL, FALSE, FALSE, NULL); - state->hUninit = CreateEventW(NULL, FALSE, FALSE, NULL); - state->hFeed = CreateEventW(NULL, FALSE, FALSE, NULL); /* for wasapi event mode */ - state->hResume = CreateEventW(NULL, FALSE, FALSE, NULL); - state->hReset = CreateEventW(NULL, FALSE, FALSE, NULL); + state->hUninit = CreateEventW(NULL, FALSE, FALSE, NULL); + state->hFeed = CreateEventW(NULL, FALSE, FALSE, NULL); /* for wasapi event mode */ + state->hResume = CreateEventW(NULL, FALSE, FALSE, NULL); + state->hReset = CreateEventW(NULL, FALSE, FALSE, NULL); if (!state->init_done || !state->hFeed || !state->hUninit || !state->hResume || !state->hReset) { @@ -400,18 +400,18 @@ static int hotplug_init(struct ao *ao) #define OPT_BASE_STRUCT struct wasapi_state const struct ao_driver audio_out_wasapi = { - .description = "Windows WASAPI audio output (event mode)", - .name = "wasapi", - .init = init, - .uninit = uninit, - .control = control, - .reset = audio_reset, - .resume = audio_resume, - .list_devs = wasapi_list_devs, - .hotplug_init = hotplug_init, + .description = "Windows WASAPI audio output (event mode)", + .name = "wasapi", + .init = init, + .uninit = uninit, + .control = control, + .reset = audio_reset, + .resume = audio_resume, + .list_devs = wasapi_list_devs, + .hotplug_init = hotplug_init, .hotplug_uninit = hotplug_uninit, - .priv_size = sizeof(wasapi_state), - .options = (const struct m_option[]) { + .priv_size = sizeof(wasapi_state), + .options = (const struct m_option[]) { OPT_FLAG("exclusive", opt_exclusive, 0), OPT_STRING("device", opt_device, 0), {NULL}, diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index afeb7d1dc0..dfe76918f9 100755 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -181,7 +181,7 @@ static char *wasapi_explain_err(const HRESULT hr) char *mp_HRESULT_to_str_buf(char *buf, size_t buf_size, HRESULT hr) { - snprintf(buf,buf_size,"%s (0x%"PRIx32")", + snprintf(buf, buf_size, "%s (0x%"PRIx32")", wasapi_explain_err(hr), (uint32_t) hr); return buf; } @@ -226,15 +226,15 @@ static void set_waveformat(WAVEFORMATEXTENSIBLE *wformat, int format, WORD valid_bits, DWORD samplerate, struct mp_chmap *channels) { - wformat->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; - wformat->Format.nChannels = channels->num; + wformat->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE; + wformat->Format.nChannels = channels->num; wformat->Format.nSamplesPerSec = samplerate; wformat->Format.wBitsPerSample = af_fmt2bits(format); wformat->Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX); - wformat->SubFormat = *format_to_subtype(format); + wformat->SubFormat = *format_to_subtype(format); wformat->Samples.wValidBitsPerSample = valid_bits ? valid_bits : wformat->Format.wBitsPerSample; - wformat->dwChannelMask = mp_chmap_to_waveext(channels); + wformat->dwChannelMask = mp_chmap_to_waveext(channels); update_waveformat_datarate(wformat); } @@ -373,8 +373,8 @@ static bool set_ao_format(struct ao *ao, WAVEFORMATEX *wf, AUDCLNT_SHAREMODE sha return false; } ao->samplerate = wf->nSamplesPerSec; - ao->format = format; - ao->channels = channels; + ao->format = format; + ao->channels = channels; } waveformat_copy(&state->format, wf); state->share_mode = share_mode; @@ -1117,8 +1117,7 @@ retry: MP_DBG(ao, "Fixing format\n"); hr = fix_format(ao); - if ((hr == AUDCLNT_E_DEVICE_IN_USE || - hr == AUDCLNT_E_DEVICE_INVALIDATED) && + if ((hr == AUDCLNT_E_DEVICE_IN_USE || hr == AUDCLNT_E_DEVICE_INVALIDATED) && retry_wait <= 8) { wasapi_thread_uninit(ao); -- cgit v1.2.3