summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2017-07-08 21:42:29 -0700
committerKevin Mitchell <kevmitch@gmail.com>2017-07-09 13:46:13 -0700
commit03abd704eccf88b3d48b91803d352c6c73a32ad5 (patch)
treeeed6cbacf05d4a80ab3f6c23b24ba859f6e4a84a /audio
parent7568715563e485c1be204d320e55bdfc803bc776 (diff)
downloadmpv-03abd704eccf88b3d48b91803d352c6c73a32ad5.tar.bz2
mpv-03abd704eccf88b3d48b91803d352c6c73a32ad5.tar.xz
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.
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_wasapi_utils.c8
1 files changed, 4 insertions, 4 deletions
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",