Fix a bug that would cause the program to crash if CSRI was selected as subtitle renderer but no CSRI renderer was actually installed. Patch by Plorkyeran, closes: 462

Originally committed to SVN as r2857.
This commit is contained in:
Karl Blomster 2009-04-26 00:11:29 +00:00
parent 4dafa0ff10
commit 32eb3a8a62
1 changed files with 5 additions and 3 deletions

View File

@ -308,8 +308,6 @@ void VideoContext::SetVideo(const wxString &filename) {
// Get frame
frame_n = 0;
//UpdateDisplays(true);
Refresh(true,true);
// Show warning
wxString warning = provider->GetWarning().c_str();
@ -389,8 +387,12 @@ void VideoContext::Refresh (bool video, bool subtitles) {
// Re-export
AssExporter exporter(grid->ass);
exporter.AddAutoFilters();
try {
subsProvider->LoadSubtitles(exporter.ExportTransform());
}
catch (wxString err) { wxMessageBox(_T("Error while invoking subtitles provider: ") + err,_T("Subtitles provider")); }
catch (const wchar_t *err) { wxMessageBox(_T("Error while invoking subtitles provider: ") + wxString(err),_T("Subtitles provider")); }
}
// Jump to frame
JumpToFrame(frame_n);