Do not use exceptions when scan file error occurs

This commit is contained in:
emeric
2015-09-02 20:56:12 +02:00
parent f58a277053
commit 14481d1e77
8 changed files with 133 additions and 134 deletions
+6 -3
View File
@@ -87,14 +87,17 @@ InputFormatContext::getBestStreamIdx(AVMediaType type, Stream::Idx& index)
}
}
void
bool
InputFormatContext::findStreamInfo(void)
{
AvError err = avformat_find_stream_info(native(), NULL);
if (err) {
if (err)
{
LMS_LOG(MOD_AV, SEV_ERROR) << "Couldn't find stream information: " << err;
throw std::runtime_error("av_find_stream_info failed!");
return false;
}
return true;
}
+1 -1
View File
@@ -47,7 +47,7 @@ class InputFormatContext : public FormatContext
Dictionary getMetadata(void); // metadata access
// Scan file
void findStreamInfo();
bool findStreamInfo();
// Get attached pictures