Only wrap the avisynth-using part of AvisynthVideoProvider's constructor with try/catch so that avisynth is still initialized when the catch handler runs, which is required to actually get an error message. Closes #1444.

Originally committed to SVN as r6438.
This commit is contained in:
Thomas Goyne 2012-02-02 20:51:07 +00:00
parent c5c829357d
commit ddc8dc9eca
1 changed files with 13 additions and 11 deletions

View File

@ -53,7 +53,7 @@
#include "standard_paths.h"
#include "video_provider_avs.h"
AvisynthVideoProvider::AvisynthVideoProvider(wxString filename) try
AvisynthVideoProvider::AvisynthVideoProvider(wxString filename)
: last_fnum(-1)
{
iframe.flipped = true;
@ -145,6 +145,7 @@ file_exit:
}
#endif
try {
AVSValue script = Open(fname, extension);
// Check if video was loaded properly
@ -158,6 +159,7 @@ file_exit:
catch (AvisynthError const& err) {
throw VideoOpenError("Avisynth error: " + std::string(err.msg));
}
}
AvisynthVideoProvider::~AvisynthVideoProvider() {
iframe.Clear();