-
DirectShow IMediaSeeker
OK, I'm playing a videofile using IMediaControl and IGraphBuilder, and it works great.
When the playback i paused and I try to seek using IMediaSeeker, it works. However, the frame at the new position doesn't show uop until the playback starts again.
How do I seek to a new position and display the frame at that position without starting the playback?
-
Perhaps some code is appropriate:
This method jumps back 0.2 seconds, but it doesn't display the fram until the playback resumes.
Code:
// DirectShow interfaces
IMediaSeeking *pMS = NULL;
//..
void GoBack()
{
HRESULT hr;
if (!pMS)
return;
if (g_psCurrent == Paused)
{
double BackTime = -0.2;
LONGLONG BackTimeFmt = BackTime * 10000000.0;
LONGLONG MediaStreamTime,CurrentMediaStreamTime,Dummy;
pMS->ConvertTimeFormat(&MediaStreamTime,NULL,BackTimeFmt,&TIME_FORMAT_MEDIA_TIME);
pMS->GetPositions(&CurrentMediaStreamTime,&Dummy);
MediaStreamTime += CurrentMediaStreamTime;
pMS->SetPositions(&MediaStreamTime,AM_SEEKING_AbsolutePositioning,NULL,AM_SEEKING_NoPositioning);
}
}
//..
By the way: Why was the forum down for about a week recently?
-