Skip to content

Commit 02c6170

Browse files
author
Clement Champetier
committed
FileProperties: throw runtime error if mime type is not found
Like other getter to properties.
1 parent f6e2fec commit 02c6170

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/AvTranscoder/properties/FileProperties.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,10 @@ std::string FileProperties::getFormatLongName() const
148148
std::string FileProperties::getFormatMimeType() const
149149
{
150150
#if LIBAVFORMAT_VERSION_MAJOR <= 55
151-
LOG_WARN("Cannot get mime type format of '" << getFilename()
152-
<< "' because your libavformat library has a major version <= 55.")
153-
return "not available";
151+
throw std::runtime_error("cannot get mime type format: libavformat library has a major version <= 55.");
154152
#else
155153
if(_avFormatContext->iformat->mime_type == NULL)
156-
{
157-
LOG_WARN("Unknown demuxer format mime type of '" << getFilename() << "'.")
158-
return "";
159-
}
154+
throw std::runtime_error("Unknown demuxer format mime type");
160155
return std::string(_avFormatContext->iformat->mime_type);
161156
#endif
162157
}

0 commit comments

Comments
 (0)