Add support for 0% and negative background rates. This isn't supported by many codecs though...

This commit is contained in:
Chris Danford
2003-08-04 00:04:28 +00:00
parent 061bf51dc1
commit c74333eeb5
5 changed files with 29 additions and 14 deletions
@@ -453,13 +453,25 @@ void MovieTexture_DShow::SetPosition( float fSeconds )
void MovieTexture_DShow::SetPlaybackRate( float fRate )
{
if( fRate == 0 )
{
this->Pause();
return;
}
SkipUpdates();
CComPtr<IMediaPosition> pMP;
m_pGB.QueryInterface(&pMP);
pMP->put_Rate(fRate);
m_pGB.QueryInterface(&pMP);
HRESULT hr = pMP->put_Rate(fRate); // fails on many codecs
StopSkippingUpdates();
if( FAILED(hr) )
{
this->Pause();
return;
}
}
bool MovieTexture_DShow::IsPlaying() const