Commit cff4da8d authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winecoreaudio: Add mechanism for cross-thread call of widHelper_NotifyCompletions.

wodSendNotifyInputCompletionsMessage sends the kWaveInNotifyCompletionsMessage to the message thread, which calls widHelper_NotifyCompletions.
parent 9ef54e4e
......@@ -284,7 +284,7 @@ static const char * getMessage(UINT msg)
#define kStopLoopMessage 0
#define kWaveOutNotifyCompletionsMessage 1
#define kWaveInCallbackMessage 2
#define kWaveInNotifyCompletionsMessage 2
/* Mach Message Handling */
static CFDataRef wodMessageHandler(CFMessagePortRef port_ReceiveInMessageThread, SInt32 msgid, CFDataRef data, void *info)
......@@ -297,7 +297,10 @@ static CFDataRef wodMessageHandler(CFMessagePortRef port_ReceiveInMessageThread,
buffer = (UInt32 *) CFDataGetBytePtr(data);
wodHelper_NotifyCompletions(&WOutDev[buffer[0]], FALSE);
break;
case kWaveInCallbackMessage:
case kWaveInNotifyCompletionsMessage:
buffer = (UInt32 *) CFDataGetBytePtr(data);
widHelper_NotifyCompletions(&WInDev[buffer[0]]);
break;
default:
CFRunLoopStop(CFRunLoopGetCurrent());
break;
......@@ -342,6 +345,25 @@ static void wodSendNotifyCompletionsMessage(WINE_WAVEOUT* wwo)
CFRelease(data);
}
/**************************************************************************
* wodSendNotifyInputCompletionsMessage [internal]
* Call from AudioUnit IO thread can't use Wine debug channels.
*/
static void wodSendNotifyInputCompletionsMessage(WINE_WAVEIN* wwi)
{
CFDataRef data;
UInt32 buffer;
buffer = (UInt32) wwi->wiID;
data = CFDataCreate(kCFAllocatorDefault, (UInt8 *)&buffer, sizeof(buffer));
if (!data)
return;
CFMessagePortSendRequest(Port_SendToMessageThread, kWaveInNotifyCompletionsMessage, data, 0.0, 0.0, NULL, NULL);
CFRelease(data);
}
static DWORD bytes_to_mmtime(LPMMTIME lpTime, DWORD position,
PCMWAVEFORMAT* format)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment