From 32eb3a8a62edd43a74f66dbc404034a429477e45 Mon Sep 17 00:00:00 2001 From: Karl Blomster Date: Sun, 26 Apr 2009 00:11:29 +0000 Subject: [PATCH] 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. --- aegisub/src/video_context.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aegisub/src/video_context.cpp b/aegisub/src/video_context.cpp index 2f4a7e870..43eb0b93f 100644 --- a/aegisub/src/video_context.cpp +++ b/aegisub/src/video_context.cpp @@ -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,7 +387,11 @@ void VideoContext::Refresh (bool video, bool subtitles) { // Re-export AssExporter exporter(grid->ass); 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