From c92ec660372d569e627b9826705e0a9202afad86 Mon Sep 17 00:00:00 2001 From: ronag Date: Fri, 23 Mar 2012 10:59:39 +0000 Subject: [PATCH] -ffmpeg_producer: Don't use ffmpeg producer for images. git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/trunk@2718 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- modules/ffmpeg/producer/util/util.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/ffmpeg/producer/util/util.cpp b/modules/ffmpeg/producer/util/util.cpp index 788563575..0542265c1 100644 --- a/modules/ffmpeg/producer/util/util.cpp +++ b/modules/ffmpeg/producer/util/util.cpp @@ -465,6 +465,17 @@ std::wstring print_mode(size_t width, size_t height, double fps, bool interlaced bool is_valid_file(const std::wstring filename) { + static const std::vector invalid_exts = boost::assign::list_of(L".png")(L".tga")(L".bmp")(L".jpg")(L".jpeg")(L".gif")(L".tiff")(L".tif")(L".jp2")(L".jpx")(L".j2k")(L".j2c"); + static std::vector valid_exts = boost::assign::list_of(L".m2t")(L".mov")(L".mp4")(L".dv")(L".flv")(L".mpg")(L".wav")(L".mp3")(L".dnxhd")(L".h264")(L".prores"); + + auto ext = boost::to_lower_copy(boost::filesystem::wpath(filename).extension()); + + if(std::find(valid_exts.begin(), valid_exts.end(), ext) != valid_exts.end()) + return true; + + if(std::find(invalid_exts.begin(), invalid_exts.end(), ext) != invalid_exts.end()) + return false; + auto filename2 = narrow(filename); if(boost::filesystem::path(filename2).extension() == ".m2t") -- 2.39.2