Sign in to follow this  
phaytal

Looping video in Direct Show

Recommended Posts

phaytal    122
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
Agony    3452
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this