X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=snd_win.c;fp=snd_win.c;h=4206cdaf6efc9cc74a4779d8ba58c801aed5e941;hb=a7738dc57ddeafb09fd5a57123498b349cee0c97;hp=91fc49135b9b68714e92828142e3615848095eef;hpb=99b0975118f01d84caf24769b8040e5eb44e72a1;p=xonotic%2Fdarkplaces.git diff --git a/snd_win.c b/snd_win.c index 91fc4913..4206cdaf 100644 --- a/snd_win.c +++ b/snd_win.c @@ -711,6 +711,8 @@ void SndSys_Submit (void) { if(developer.integer >= 1000) Con_Print("waveOutWrite failed (too much sound data)\n"); + //h->dwFlags |= WHDR_DONE; + //snd_sent++; } else { @@ -735,6 +737,8 @@ Returns the number of sample frames consumed since the sound started unsigned int SndSys_GetSoundTime (void) { unsigned int factor; + MMRESULT res; + MMTIME mmtime; factor = snd_renderbuffer->format.width * snd_renderbuffer->format.channels; @@ -755,6 +759,7 @@ unsigned int SndSys_GetSoundTime (void) if (wav_init) { + /* // Find which sound blocks have completed for (;;) { @@ -771,6 +776,12 @@ unsigned int SndSys_GetSoundTime (void) } return (snd_completed * wav_buffer_size) / factor; + */ + + mmtime.wType = TIME_SAMPLES; + res = waveOutGetPosition(hWaveOut, &mmtime, sizeof(mmtime)); + if(res == MMSYSERR_NOERROR) + return mmtime.u.sample; } return 0;