mmdevapi: Clock rate should be in bytes for shared mode.

This commit is contained in:
Andrew Eikum 2014-05-19 08:59:26 -05:00 committed by Alexandre Julliard
parent b634666e13
commit 0e84a59d89
4 changed files with 23 additions and 5 deletions

View file

@ -955,7 +955,7 @@ static void test_clock(int share)
trace("Clock Frequency %u\n", (UINT)freq);
/* MSDN says it's arbitrary units, but shared mode is unlikely to change */
if (share) todo_wine
if (share)
ok(freq == pwfx->nSamplesPerSec * pwfx->nBlockAlign,
"Clock Frequency %u\n", (UINT)freq);
else

View file

@ -2822,7 +2822,10 @@ static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq)
TRACE("(%p)->(%p)\n", This, freq);
*freq = This->fmt->nSamplesPerSec;
if(This->share == AUDCLNT_SHAREMODE_SHARED)
*freq = This->fmt->nSamplesPerSec * This->fmt->nBlockAlign;
else
*freq = This->fmt->nSamplesPerSec;
return S_OK;
}
@ -2879,7 +2882,10 @@ static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos,
TRACE("frames written: %u, held: %u, avail: %ld, delay: %ld state %d, pos: %u\n",
(UINT32)(written_frames%1000000000), held_frames,
avail_frames, delay_frames, alsa_state, (UINT32)(position%1000000000));
*pos = position;
if(This->share == AUDCLNT_SHAREMODE_SHARED)
*pos = position * This->fmt->nBlockAlign;
else
*pos = position;
if(qpctime){
LARGE_INTEGER stamp, freq;

View file

@ -2420,7 +2420,10 @@ static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq)
TRACE("(%p)->(%p)\n", This, freq);
*freq = This->fmt->nSamplesPerSec;
if(This->share == AUDCLNT_SHAREMODE_SHARED)
*freq = This->fmt->nSamplesPerSec * This->fmt->nBlockAlign;
else
*freq = This->fmt->nSamplesPerSec;
return S_OK;
}
@ -2435,6 +2438,9 @@ static HRESULT AudioClock_GetPosition_nolock(ACImpl *This,
else
*pos = This->inbuf_frames + This->written_frames;
if(This->share == AUDCLNT_SHAREMODE_SHARED)
*pos *= This->fmt->nBlockAlign;
if(qpctime){
LARGE_INTEGER stamp, freq;
QueryPerformanceCounter(&stamp);

View file

@ -2145,7 +2145,10 @@ static HRESULT WINAPI AudioClock_GetFrequency(IAudioClock *iface, UINT64 *freq)
TRACE("(%p)->(%p)\n", This, freq);
*freq = This->fmt->nSamplesPerSec;
if(This->share == AUDCLNT_SHAREMODE_SHARED)
*freq = This->fmt->nSamplesPerSec * This->fmt->nBlockAlign;
else
*freq = This->fmt->nSamplesPerSec;
return S_OK;
}
@ -2195,6 +2198,9 @@ static HRESULT WINAPI AudioClock_GetPosition(IAudioClock *iface, UINT64 *pos,
This->last_pos_frames = *pos;
if(This->share == AUDCLNT_SHAREMODE_SHARED)
*pos *= This->fmt->nBlockAlign;
LeaveCriticalSection(&This->lock);
if(qpctime){