[madplay]:audio_win32.c::struct buffer.event_handle: Can not find the time that sets the event object to the signaled state
cnmmd <[email protected]> Fri, 19 Aug 2005 13:26:02 +0800
| Newsgroups | gmane.comp.audio.mad.devel |
|---|---|
| Message-ID | <[email protected]> |
1'st Init()
{
...
output[i].event_handle = CreateEvent(0, FALSE /* manual reset */,
FALSE /* initial state */, 0);
..
}
After this ,the event_handle is nonsignaled state.
but in function:
int wait(struct buffer *buffer)
{
MMRESULT error;
DWORD tick;
if (!buffer->playing)
return 0;
tick = GetTickCount();
switch (WaitForSingleObject(buffer->event_handle, INFINITE)) {
..
}
why the event_handle is signaled state?
I only find this time to setevent:
void CALLBACK callback(HWAVEOUT handle, UINT message, DWORD data,
DWORD param1, DWORD param2)
{
WAVEHDR *header;
struct buffer *buffer;
switch (message) {
case WOM_DONE:
header = (WAVEHDR *) param1;
buffer = (struct buffer *) header->dwUser;
if (SetEvent(buffer->event_handle) == 0) {
...
}
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/