2012-08-15, 12:25
(2012-08-15, 04:21)DDDamian Wrote: @Ace - you are mostly correct - the return value is in 100ns units, and the conversion to seconds does require that division. My dev branch includes that fix and one more: the result should be multiplied by 2x as there are actually two buffers of that duration which are filled prior to playback actually starting - this is contrary to Microsofts' descriptions on MSDN, but I have verified it via a somewhat complex tracking of the actual hardware buffer pointers with other development code. Further comments & details on GitHub in the PR mentioned above.
I'm a bit concerned if that is sufficient. Using the old conversion the crash happened within seconds, if not instantly.
With the new one it happened within minutes. Maybe the old conv. led to a higher frequency of calling GetCurrentPadding(...) and therefore increased the chance of calling GetBuffer(...) and GetCurrentPadding(...) at the same time, which leads to a crash.
So maybe your return value only reduces this chance?
But you are way more into this stuff than me, what do you think?