From 03abd704eccf88b3d48b91803d352c6c73a32ad5 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Sat, 8 Jul 2017 21:42:29 -0700 Subject: ao_wasapi: reorder channels and samplerates to speed up search This shouldn't affect which are chosen, but it should speed up the search by putting more common configurations earlier so that a working sample format and sample rates can be found sooner obviating the need to search them for each iteration of the outer loops. --- audio/out/ao_wasapi_utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'audio') diff --git a/audio/out/ao_wasapi_utils.c b/audio/out/ao_wasapi_utils.c index d334412b5d..949187a419 100644 --- a/audio/out/ao_wasapi_utils.c +++ b/audio/out/ao_wasapi_utils.c @@ -372,9 +372,9 @@ static bool search_sample_formats(struct ao *ao, WAVEFORMATEXTENSIBLE *wformat, static bool search_samplerates(struct ao *ao, WAVEFORMATEXTENSIBLE *wformat, struct mp_chmap *channels) { - // try list of typical sample rates (requests welcome) - int try[] = {8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200, 96000, - 176400, 192000, 352800, 384000, 0}; + // put common samplerates first so that we find format early + int try[] = {48000, 44100, 96000, 88200, 192000, 176400, + 32000, 22050, 11025, 8000, 16000, 352800, 384000, 0}; // get a list of supported rates int n = 0; @@ -410,7 +410,7 @@ static bool search_channels(struct ao *ao, WAVEFORMATEXTENSIBLE *wformat) struct mp_chmap entry; // put common layouts first so that we find sample rate/format early char *channel_layouts[] = - {"mono", "stereo", "2.1", "4.0", "5.0", "5.1", "6.1", "7.1", + {"stereo", "5.1", "7.1", "6.1", "mono", "2.1", "4.0", "5.0", "3.0", "3.0(back)", "quad", "quad(side)", "3.1", "5.0(side)", "4.1", -- cgit v1.2.3