Nikolay Sivov : mf: Set approximate occurrence time for MESessionStopped/MESessionEnded events.

Alexandre Julliard julliard at winehq.org
Tue Apr 14 16:15:27 CDT 2020


Module: wine
Branch: master
Commit: 08cdea91ba65548cc4e52a144d36dad5eb85d5de
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=08cdea91ba65548cc4e52a144d36dad5eb85d5de

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Apr 14 18:03:46 2020 +0300

mf: Set approximate occurrence time for MESessionStopped/MESessionEnded events.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mf/session.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/mf/session.c b/dlls/mf/session.c
index 076327920a..75ef600a4d 100644
--- a/dlls/mf/session.c
+++ b/dlls/mf/session.c
@@ -207,10 +207,11 @@ struct media_session
     {
         IMFTopology *current_topology;
         MF_TOPOSTATUS topo_status;
+        MFTIME clock_stop_time;
+        unsigned int flags;
         struct list sources;
         struct list sinks;
         struct list nodes;
-        DWORD flags;
 
         /* Latest Start() arguments. */
         GUID time_format;
@@ -829,10 +830,17 @@ static void session_pause(struct media_session *session)
 static void session_set_stopped(struct media_session *session, HRESULT status)
 {
     MediaEventType event_type;
+    IMFMediaEvent *event;
 
     session->state = SESSION_STATE_STOPPED;
     event_type = session->presentation.flags & SESSION_FLAG_END_OF_PRESENTATION ? MESessionEnded : MESessionStopped;
-    IMFMediaEventQueue_QueueEventParamVar(session->event_queue, event_type, &GUID_NULL, status, NULL);
+
+    if (SUCCEEDED(MFCreateMediaEvent(event_type, &GUID_NULL, status, NULL, &event)))
+    {
+        IMFMediaEvent_SetUINT64(event, &MF_SESSION_APPROX_EVENT_OCCURRENCE_TIME, session->presentation.clock_stop_time);
+        IMFMediaEventQueue_QueueEvent(session->event_queue, event);
+        IMFMediaEvent_Release(event);
+    }
 }
 
 static void session_stop(struct media_session *session)
@@ -847,6 +855,7 @@ static void session_stop(struct media_session *session)
         case SESSION_STATE_PAUSED:
 
             /* Transition in two steps - pause clock, wait for sinks and pause sources. */
+            IMFPresentationClock_GetTime(session->clock, &session->presentation.clock_stop_time);
             if (SUCCEEDED(hr = IMFPresentationClock_Stop(session->clock)))
                 session->state = SESSION_STATE_STOPPING_SINKS;
             else




More information about the wine-cvs mailing list