Jump to content
  • Advertisement
Sign in to follow this  
phaytal

Looping video in Direct Show

This topic is 5088 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

Hey guys. I need a function that endlessly loops a 20 second video file in my menu system. It has been awhile since I worked with DShow in depth so any help would be greatly appreciated. I know I need to check if(pMediaControl->Stop) but I'm not sure what to call to seamlessly restart the video. I found these two flags through other searches but dont know how to use them.(AM_SEEKING_AbsolutePositioning and AM_SEEKING_NoPositioning) Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Here's the code [roughly] that I'm using:

LONG EventCode, Parameter1, Parameter2;
if (mpMediaEvent != NULL)
{
mpMediaEvent->GetEvent(&EventCode, &Parameter1, &Parameter2, 0);
if (EventCode == EC_COMPLETE)
{
if (mpMediaSeeking != NULL)
{
LONGLONG Time = 0;
GUID TimeFormat = TIME_FORMAT_FRAME;
mpMediaSeeking->SetTimeFormat(&TimeFormat);
mpMediaSeeking->SetPositions(&Time, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning);
}
}
}

Although my code is a wee bit messed up right now, and I honestly can't remember if you would also need to call mpMediaControl->Run(); as well, or if it is still in the running state already.

[edit]silly code corrections[/edit]

Share this post


Link to post
Share on other sites
Im never changing the time format so I didnt need that, but your function will work well for me.

Thanks a bunch!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!