summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2015-12-21 09:45:32 -0800
committerKevin Mitchell <kevmitch@gmail.com>2015-12-21 16:58:51 -0800
commit5afa68835ade9f21f9c709f791319bf9d2e35265 (patch)
treec9a427353ca228c4c4bd415d93e631e8ee0c27d5 /demux
parent5360baa49e630048b2454504c9a5d2ffe4e3651f (diff)
downloadmpv-5afa68835ade9f21f9c709f791319bf9d2e35265.tar.bz2
mpv-5afa68835ade9f21f9c709f791319bf9d2e35265.tar.xz
ao_wasapi: fix delay calculation
Make sure that subtraction of performance counters is done correctly. Follow the *exact* instructions for converting performance counter to something comparable to the QPCposition returned by IAudioClient::GetPosition https://msdn.microsoft.com/en-us/library/windows/desktop/dd370889%28v=vs.85%29.aspx Also make sure that subtraction of unsigned integers is stored into a signed integer to avoid nastiness. Also be more careful about overflow in the conversion of the device position into number of samples. Avoid casting mp_time_us() to a double, and use llrint to convert the double precision delay_us back to integer for ao_read_data. Finally, actually check the return value of ao_read_data and add a verbose message if it is not the expected value. Unfortunately, there is no way to tell WASAPI when this happens since the frame_count in ReleaseBuffer must match GetBuffer.
Diffstat (limited to 'demux')
0 files changed, 0 insertions, 0 deletions