Skip to content

Commit

Permalink
Исправлен баг EVR-CP с выводом ошибки "Failed to RegisterClass" для с…
Browse files Browse the repository at this point in the history
…лучая, когда воспроизведение принудительно завершается после первого кадра. Возможно будут устранены и другие связанные баги.

Суть. Внешний EVR по какой-то причине упорно ожидает второй кадр. Если воспроизведение принудительно завершить, то EVR-CP не уничтожиться при удалении графа, что создаст проблемы. Чтобы этого избежать, необходимо сделать сброс позиции.
  • Loading branch information
v0lt committed Apr 1, 2022
1 parent 6dff56c commit 0037ed4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/apps/mplayerc/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14296,10 +14296,17 @@ void CMainFrame::CloseMediaPrivate()
Content::Online::Clear();

if (m_pMC) {
if (GetPlaybackMode() == PM_FILE) {
// Requires a position reset so that the EVR-CP stops waiting for the next frame
// when playback ends immediately after the first frame.
LONGLONG pos = 0;
m_pMS->SetPositions(&pos, AM_SEEKING_AbsolutePositioning, nullptr, AM_SEEKING_NoPositioning);
}
OAFilterState fs;
m_pMC->GetState(0, &fs);
if (fs != State_Stopped) {
m_pMC->Stop(); // Some filters, such as Microsoft StreamBufferSource, need to call IMediaControl::Stop() before close the graph;
// Some filters, such as Microsoft StreamBufferSource, need to call IMediaControl::Stop() before close the graph;
m_pMC->Stop();
}
}
m_bCapturing = false;
Expand Down

0 comments on commit 0037ed4

Please sign in to comment.