Add handling for invalid timecode errors when opening video

Originally committed to SVN as r5059.
This commit is contained in:
Thomas Goyne 2010-12-29 19:35:45 +00:00
parent bd7ac88f6b
commit 73c0515954

View file

@ -67,6 +67,7 @@ VideoProvider *VideoProviderFactory::GetProvider(wxString video) {
std::string errors; std::string errors;
errors.reserve(1024); errors.reserve(1024);
for (int i = 0; i < (signed)list.size(); ++i) { for (int i = 0; i < (signed)list.size(); ++i) {
std::string err;
try { try {
VideoProvider *provider = Create(list[i], video); VideoProvider *provider = Create(list[i], video);
LOG_I("manager/video/provider") << list[i] << ": opened " << STD_STR(video); LOG_I("manager/video/provider") << list[i] << ": opened " << STD_STR(video);
@ -76,24 +77,25 @@ VideoProvider *VideoProviderFactory::GetProvider(wxString video) {
return provider; return provider;
} }
catch (agi::FileNotFoundError const&) { catch (agi::FileNotFoundError const&) {
std::string err = list[i] + ": " + STD_STR(video) + " not found."; err = list[i] + ": file not found.";
errors += err + "\n";
LOG_D("manager/video/provider") << err;
// Keep trying other providers as this one may just not be able to // Keep trying other providers as this one may just not be able to
// open a valid path // open a valid path
} }
catch (VideoNotSupported const&) { catch (VideoNotSupported const&) {
fileFound = true; fileFound = true;
std::string err = list[i] + ": " + STD_STR(video) + " is not in a supported format.\n"; err = list[i] + ": video is not in a supported format.";
errors += err + "\n";
LOG_D("manager/video/provider") << err;
} }
catch (VideoOpenError const& ex) { catch (VideoOpenError const& ex) {
fileSupported = true; fileSupported = true;
std::string err = list[i] + ": " + ex.GetMessage(); err = list[i] + ": " + ex.GetMessage();
errors += err + "\n";
LOG_D("manager/video/provider") << err;
} }
catch (agi::vfr::Error const& ex) {
fileSupported = true;
err = list[i] + ": " + ex.GetMessage();
}
errors += err;
errors += "\n";
LOG_D("manager/video/provider") << err;
} }
// No provider could open the file // No provider could open the file