Skip to content

Commit

Permalink
Improve issue #44
Browse files Browse the repository at this point in the history
  • Loading branch information
jakky1 committed Nov 6, 2024
1 parent 6e5bbee commit ae6ae89
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions windows/my_grabber_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ LONGLONG MyPlayer::GetCurrentPosition()

HRESULT MyPlayer::Seek(LONGLONG ms)
{
HRESULT hr;
if (!m_pEngine) return E_FAIL;

if (!m_isPlaying)
Expand All @@ -403,9 +402,8 @@ HRESULT MyPlayer::Seek(LONGLONG ms)
SetEvent(m_playingEvent);
}
//return m_pEngine->SetCurrentTime((double)ms / 1000);
hr = m_pEngineEx->SetCurrentTimeEx((double)ms / 1000, MF_MEDIA_ENGINE_SEEK_MODE_APPROXIMATE );
if (SUCCEEDED(hr) && m_isEnded) Play(); // Fix issue#44: seek() after ended, will play audio without video frames...
return hr;
if (m_isEnded) Play(); // Fix issue#44: seek() after ended, will play audio without video frames...
return m_pEngineEx->SetCurrentTimeEx((double)ms / 1000, MF_MEDIA_ENGINE_SEEK_MODE_APPROXIMATE );
}

SIZE MyPlayer::GetVideoSize()
Expand Down

0 comments on commit ae6ae89

Please sign in to comment.