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

View file

@ -308,8 +308,6 @@ void VideoContext::SetVideo(const wxString &filename) {
// Get frame // Get frame
frame_n = 0; frame_n = 0;
//UpdateDisplays(true);
Refresh(true,true);
// Show warning // Show warning
wxString warning = provider->GetWarning().c_str(); wxString warning = provider->GetWarning().c_str();
@ -389,7 +387,11 @@ void VideoContext::Refresh (bool video, bool subtitles) {
// Re-export // Re-export
AssExporter exporter(grid->ass); AssExporter exporter(grid->ass);
exporter.AddAutoFilters(); exporter.AddAutoFilters();
subsProvider->LoadSubtitles(exporter.ExportTransform()); 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 // Jump to frame