@@ -74,7 +74,6 @@ struct DMUS_PMSGItem {
74
74
DMUS_PMSGItem * next ;
75
75
DMUS_PMSGItem * prev ;
76
76
77
- REFERENCE_TIME rtItemTime ;
78
77
BOOL bInUse ;
79
78
DWORD cb ;
80
79
DMUS_PMSG pMsg ;
@@ -141,14 +140,14 @@ static DWORD WINAPI ProcessMsgThread(LPVOID lpParam) {
141
140
it = it_next ;
142
141
}
143
142
144
- for (it = This -> head ; NULL != it && it -> rtItemTime < rtCurTime + dwDec ; ) {
143
+ for (it = This -> head ; NULL != it && it -> pMsg . rtTime < rtCurTime + dwDec ; ) {
145
144
it_next = it -> next ;
146
145
cur = ProceedMsg (This , it );
147
146
free (cur );
148
147
it = it_next ;
149
148
}
150
149
if (NULL != it ) {
151
- timeOut = ( it -> rtItemTime - rtCurTime ) + This -> rtLatencyTime ;
150
+ timeOut = ( it -> pMsg . rtTime - rtCurTime ) + This -> rtLatencyTime ;
152
151
}
153
152
154
153
outrefresh :
@@ -425,11 +424,22 @@ static HRESULT WINAPI performance_SendPMsg(IDirectMusicPerformance8 *iface, DMUS
425
424
hr = DMUS_E_ALREADY_SENT ;
426
425
else
427
426
{
428
- /* TODO: Valid Flags */
429
- /* TODO: DMUS_PMSGF_MUSICTIME */
430
- message -> rtItemTime = msg -> rtTime ;
427
+ if (!(msg -> dwFlags & DMUS_PMSGF_MUSICTIME ))
428
+ {
429
+ if (FAILED (hr = IDirectMusicPerformance8_ReferenceToMusicTime (iface ,
430
+ msg -> rtTime , & msg -> mtTime )))
431
+ goto done ;
432
+ msg -> dwFlags |= DMUS_PMSGF_MUSICTIME ;
433
+ }
434
+ if (!(msg -> dwFlags & DMUS_PMSGF_REFTIME ))
435
+ {
436
+ if (FAILED (hr = IDirectMusicPerformance8_MusicToReferenceTime (iface ,
437
+ msg -> mtTime , & msg -> rtTime )))
438
+ goto done ;
439
+ msg -> dwFlags |= DMUS_PMSGF_REFTIME ;
440
+ }
431
441
432
- for (it = * queue ; NULL != it && it -> rtItemTime < message -> rtItemTime ; it = it -> next )
442
+ for (it = * queue ; NULL != it && it -> pMsg . rtTime < message -> pMsg . rtTime ; it = it -> next )
433
443
prev_it = it ;
434
444
435
445
if (!prev_it )
@@ -452,6 +462,7 @@ static HRESULT WINAPI performance_SendPMsg(IDirectMusicPerformance8 *iface, DMUS
452
462
hr = S_OK ;
453
463
}
454
464
465
+ done :
455
466
LeaveCriticalSection (& This -> safe );
456
467
457
468
return hr ;
0 commit comments