WMF: fix initializing of media player's volume.
authorNodir Temirkhodjaev <nodir.temir@gmail.com>
Sat, 30 Aug 2014 11:41:30 +0000 (16:41 +0500)
committerYoann Lopes <yoann.lopes@digia.com>
Thu, 11 Sep 2014 12:31:11 +0000 (14:31 +0200)
According to the docs, MESessionTopologyStatus with status == MF_TOPOSTATUS_READY should be the correct place for the GetService call.

Change-Id: I7fdbedbe43b2191b35b95c7fd9c86940f58daff7
Reviewed-by: Wouter Huysentruit <wouter_huysentruit@hotmail.com>
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
src/plugins/wmf/player/mfplayersession.cpp

index 4b83e72..0de0bdf 100644 (file)
@@ -1638,9 +1638,6 @@ void MFPlayerSession::handleSessionEvent(IMFMediaEvent *sessionEvent)
                 }
             }
 
-            if (SUCCEEDED(MFGetService(m_session, MR_STREAM_VOLUME_SERVICE, IID_PPV_ARGS(&m_volumeControl))))
-                setVolumeInternal(m_muted ? 0 : m_volume);
-
             DWORD dwCharacteristics = 0;
             m_sourceResolver->mediaSource()->GetCharacteristics(&dwCharacteristics);
             emit seekableUpdate(MFMEDIASOURCE_CAN_SEEK & dwCharacteristics);
@@ -1711,6 +1708,9 @@ void MFPlayerSession::handleSessionEvent(IMFMediaEvent *sessionEvent)
                         }
                     }
                     MFGetService(m_session, MFNETSOURCE_STATISTICS_SERVICE, IID_PPV_ARGS(&m_netsourceStatistics));
+
+                    if (SUCCEEDED(MFGetService(m_session, MR_STREAM_VOLUME_SERVICE, IID_PPV_ARGS(&m_volumeControl))))
+                        setVolumeInternal(m_muted ? 0 : m_volume);
                 }
             }
         }