summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_wasapi0.c
Commit message (Collapse)AuthorAgeFilesLines
* ao_wasapi0: Rename to ao_wasapiDiogo Franco (Kovensky)2013-07-221-1194/+0
| | | | | Nobody knows what the 0 was for. There's no "WASAPI version 0". Just take it out.
* ao_wasapi0: Use the mix format directly in try_mix_formatDiogo Franco (Kovensky)2013-07-221-0/+2
|
* ao_wasapi0: Don't complain about failed init during AO probingDiogo Franco (Kovensky)2013-07-221-8/+10
| | | | Only if the user specifically asked for ao_wasapi0.
* ao_wasapi0: Don't fail init when listing devicesDiogo Franco (Kovensky)2013-07-221-2/+0
|
* ao_wasapi0: Demote "negotiation failed" message to MSGL_VDiogo Franco (Kovensky)2013-07-221-2/+2
| | | | | Could spam the console with what may be harmless in some cases. We already complain loudly if we're stuck checking this too many times.
* ao_wasapi0: Support shared mode, better format guessing methodDiogo Franco (Kovensky)2013-07-221-72/+258
| | | | | | | | | | | | | | | | | | | | | | Uses WASAPI in shared mode by default, add :exclusive flag to choose exclusive mode (duh). WASAPI works somewhat different in shared mode: the OS suggests the sample format to use, and the GetBuffer call is done slightly differently. The shared mode driver does not consume audio as fast as it notifies the thread; we need to check how much we're allowed to write. Not doing this correctly results in spamming the console with AUDCLNT_E_BUFFER_TOO_LARGE errors. When guessing formats for exclusive mode, try several sample size and sample rate combinations instead of just falling back to s16le@44100hz. If none of the rates are accepted, tries remixing >6 channels to 5.1 channels. Failing that, tries remixing to stereo. Failing everything, including the CD Red Book format, what else is left to test? Calculate buffer_block_size based on the configured channels and bytes per sample; MSDN docs say nBlockAlign is not guaranteed to be set for anything but integer PCM formats.
* ao_wasapi0: Support device enumeration and selectionDiogo Franco (Kovensky)2013-07-221-3/+215
| | | | | | | | | Adds the :list suboption to ao_wasapi0, which enumerates the audio endpoints in the system. Adds the :device=<n> suboption, which either takes an ID string (as output by list) or a device number and uses the requested device instead of the system default.
* ao_wasapi0: Don't starve the WASAPI thread on seeksDiogo Franco (Kovensky)2013-07-201-6/+11
| | | | | | | | | | Seeking calls thread_reset, but doesn't call thread_play. thread_reset would disable WASAPI events, but they would never get re-enabled unless the user paused and then unpaused. Keep track of whether the stream is paused or not (there already was a field for that, but it was apparently unused), and if it's not paused, call thread_play after thread_reset. Fixes mpv freezing after seeks.
* ao_wasapi0: Don't release WASAPI buffer twiceDiogo Franco (Kovensky)2013-07-201-0/+1
| | | | Would cause bogus AUDCLNT_E_OUT_OF_ORDER errors.
* ao_wasapi0: Make it compile on cygwin64Diogo Franco (Kovensky)2013-07-201-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes format specifies that assume windows TYPEDEFS are as long as they look like they are. Remove calls to _beginthreadex and _endthreadex, these are only present on microsoft's C runtimes. Replace by the otherwise identical CreateThread and ExitThread calls. This actually requires fixes to devicetopology.h, but the problem has been (kinda) reported to mingw-w64: <Kovensky> I see that those KSJACK* structs are supposedly declared in devicetopology.h itself, but for some reason (some of?) the decls that use them aren't seeing them? <Kovensky> ok, it seems that it expects ks.h and ksmedia.h to declare those structs, but it doesn't <Kovensky> the included files declare KDATAFORMAT, KSIDENTIFIER and LUID (and the associated pointer typedefs) <Kovensky> but everything else is essentially inside #if 0 <Kovensky> changing the #ifndef _KS_ to only include KDATAFORMAT, KSIDENTIFIER and LUID (and putting the KSJACK stuff outside that #ifndef) makes the header compile <Kovensky> it solves my immediate problem, but if that happened to begin with there's probably something more wrong with the ks headers :S
* ao_wasapi0: use new mp_ring bufferJonathan Yong2013-07-121-82/+25
|
* ao_wasapi0: add new wasapi event mode aoJonathan Yong2013-06-181-0/+840