{"action":"created","issue":{"url":"https://api.github.com/repos/mpv-player/mpv/issues/1499","labels_url":"https://api.github.com/repos/mpv-player/mpv/issues/1499/labels{/name}","comments_url":"https://api.github.com/repos/mpv-player/mpv/issues/1499/comments","events_url":"https://api.github.com/repos/mpv-player/mpv/issues/1499/events","html_url":"https://github.com/mpv-player/mpv/pull/1499","id":55141610,"number":1499,"title":"Fix WASAPI format selection for unsupported formats in shared mode","user":{"login":"rossy","id":162837,"avatar_url":"https://avatars.githubusercontent.com/u/162837?v=3","gravatar_id":"","url":"https://api.github.com/users/rossy","html_url":"https://github.com/rossy","followers_url":"https://api.github.com/users/rossy/followers","following_url":"https://api.github.com/users/rossy/following{/other_user}","gists_url":"https://api.github.com/users/rossy/gists{/gist_id}","starred_url":"https://api.github.com/users/rossy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossy/subscriptions","organizations_url":"https://api.github.com/users/rossy/orgs","repos_url":"https://api.github.com/users/rossy/repos","events_url":"https://api.github.com/users/rossy/events{/privacy}","received_events_url":"https://api.github.com/users/rossy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-22T11:18:35Z","updated_at":"2015-01-22T23:10:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mpv-player/mpv/pulls/1499","html_url":"https://github.com/mpv-player/mpv/pull/1499","diff_url":"https://github.com/mpv-player/mpv/pull/1499.diff","patch_url":"https://github.com/mpv-player/mpv/pull/1499.patch"},"body":"I've been having trouble with ao_wasapi on my work laptop (Windows 7, SigmaTel STAC9228 sound card.) It would only successfully select a format when the sample rate of the file matched the mix format. With other sample rates, it would try to select a matching format and fail init ([log][1].)\r\n\r\nI think this was happening because the old code misinterpreted the docs and treated AUDCLNT_E_UNSUPPORTED_FORMAT as success instead of failure in shared mode (see the commit message.) This patch fixes it for me by treating that return code as failure, so it will fall back to the mix format.\r\n\r\nInterestingly, none of my machines at home have this problem because they never fail in IsFormatSupported and always return the mix format in ``closestMatch``.\r\n\r\n[1]: https://gist.github.com/rossy/60169dedf80883968519"},"comment":{"url":"https://api.github.com/repos/mpv-player/mpv/issues/comments/71118411","html_url":"https://github.com/mpv-player/mpv/pull/1499#issuecomment-71118411","issue_url":"https://api.github.com/repos/mpv-player/mpv/issues/1499","id":71118411,"user":{"login":"kevmitch","id":116549,"avatar_url":"https://avatars.githubusercontent.com/u/116549?v=3","gravatar_id":"","url":"https://api.github.com/users/kevmitch","html_url":"https://github.com/kevmitch","followers_url":"https://api.github.com/users/kevmitch/followers","following_url":"https://api.github.com/users/kevmitch/following{/other_user}","gists_url":"https://api.github.com/users/kevmitch/gists{/gist_id}","starred_url":"https://api.github.com/users/kevmitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevmitch/subscriptions","organizations_url":"https://api.github.com/users/kevmitch/orgs","repos_url":"https://api.github.com/users/kevmitch/repos","events_url":"https://api.github.com/users/kevmitch/events{/privacy}","received_events_url":"https://api.github.com/users/kevmitch/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T23:10:01Z","updated_at":"2015-01-22T23:10:01Z","body":"I thought this was kind of weird, but was afraid to change it since it \"worked for me\". I'll merge this later tonight unless anyone else objects."}}