From 04931ddb2daf1f54cfb7efdd0f9a7414532a72f2 Mon Sep 17 00:00:00 2001 From: slllllala <37529654+dsfdeeeg@users.noreply.github.com> Date: Thu, 7 Nov 2019 14:42:39 +0800 Subject: [PATCH] Avoid reading pictures After reading the video, use it to read the image, and the image does not display --- src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp b/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp index 2d52bff23..24417a9eb 100644 --- a/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp +++ b/src/osgPlugins/ffmpeg/ReaderWriterFFmpeg.cpp @@ -135,6 +135,9 @@ public: virtual ReadResult readImage(const std::string & filename, const osgDB::ReaderWriter::Options* options) const { const std::string ext = osgDB::getLowerCaseFileExtension(filename); + const std::string pro = osgDB::getServerProtocol(filename); + if (!acceptsExtension(ext) && !acceptsProtocol(pro)) return ReadResult::FILE_NOT_HANDLED; + if (ext=="ffmpeg") return readImage(osgDB::getNameLessExtension(filename),options); osg::ref_ptr parameters(new osgFFmpeg::FFmpegParameters);