Advertisement Jump to content
Sign in to follow this  
sipickles

VMR-9 - can't detect when movie has ended

This topic is 4209 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am using VMR-9 to render videos, like the sample VMR9allocator. Unfortunately, I cannot tell if the video has ended playing. The sample uses this code:
//CComPtr<IMediaControl> g_mediaControl;

        OAFilterState state;
        g_mediaControl->GetState(0, & state );

Unfortunately, when the video has ended, state continues to be 'State_Running'. Can anyone suggest an alternative way? Simon

Share this post


Link to post
Share on other sites
Advertisement
Hi ,you cannot test if the movie ended using the state , instead try something like this:


CComPtr<IMediaEvent> m_pEvent;
...
m_pGraph->QueryInterface(IID_IMediaEvent, reinterpret_cast<void**>(&m_pEvent));

...

long evCode = 0;
m_pEvent->WaitForCompletion(0, &evCode);

if(evCode==EC_COMPLETE)
{

// movie ended

}



Hope this helps

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!