Skip to content

Commit 981e7c7

Browse files
author
Clement Champetier
committed
util: removed matchFormat method
Used only once, inside OutputFile class.
1 parent 6be73f0 commit 981e7c7

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

src/AvTranscoder/file/OutputFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void OutputFile::setupWrapping(const ProfileLoader::Profile& profile)
266266
}
267267

268268
// check if output format indicated is valid with the filename extension
269-
if(!matchFormat(profile.find(constants::avProfileFormat)->second, getFilename()))
269+
if(!av_guess_format(profile.find(constants::avProfileFormat)->second.c_str(), getFilename().c_str(), NULL))
270270
{
271271
throw std::runtime_error("Invalid format according to the file extension.");
272272
}

src/AvTranscoder/util.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ extern "C" {
1212
namespace avtranscoder
1313
{
1414

15-
bool matchFormat(const std::string& format, const std::string& filename)
16-
{
17-
AVOutputFormat* avOutputFormat = av_guess_format(format.c_str(), filename.c_str(), NULL);
18-
return avOutputFormat != NULL;
19-
}
20-
2115
std::vector<std::string> getSupportedPixelFormats(const std::string& videoCodecName)
2216
{
2317
std::vector<std::string> pixelFormats;

src/AvTranscoder/util.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ namespace avtranscoder
1919
typedef std::map<std::string, OptionArray> OptionArrayMap;
2020
typedef std::map<std::string, std::string> NamesArray; //< short/long names of format/video codec/audio codec
2121

22-
/**
23-
* @brief Check if a format name corresponds to the format of a given filename
24-
*/
25-
bool AvExport matchFormat(const std::string& format, const std::string& filename);
26-
2722
/**
2823
* @brief Get pixel format supported by a video codec.
2924
* @param videoCodecName: the video codec name (empty if not indicated, and so get all pixel formats supported by all video

0 commit comments

Comments
 (0)