From 3d4169689d035a753822e5a4cb67fbcefe59f391 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 7 Jan 2010 09:45:34 +0000 Subject: [PATCH] From Serge Lages, "Here is a modified fix. It doesn't break the other patch for this plugin as they are for different files. I've only added the file formats handled by default with DirectShow (based on its Wikipedia page)." --- src/osgPlugins/directshow/ReaderWriterDirectShow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/directshow/ReaderWriterDirectShow.cpp b/src/osgPlugins/directshow/ReaderWriterDirectShow.cpp index 605d82791..77a133200 100644 --- a/src/osgPlugins/directshow/ReaderWriterDirectShow.cpp +++ b/src/osgPlugins/directshow/ReaderWriterDirectShow.cpp @@ -28,6 +28,11 @@ public: ReaderWriterDirectShow() { + supportsExtension("directshow", ""); + supportsExtension("avi", ""); + supportsExtension("wmv", "Windows Media Video format"); + supportsExtension("mpg", "Mpeg movie format"); + supportsExtension("mpeg", "Mpeg movie format"); } virtual ~ReaderWriterDirectShow() @@ -42,13 +47,15 @@ public: virtual ReadResult readImage(const std::string & filename, const osgDB::ReaderWriter::Options * options) const { const std::string ext = osgDB::getLowerCaseFileExtension(filename); - if (ext=="directshow") return readImage(osgDB::getNameLessExtension(filename),options); + if (ext=="directshow") return readImageStream(osgDB::getNameLessExtension(filename),options); + if (! acceptsExtension(ext)) + return ReadResult::FILE_NOT_HANDLED; return readImageStream(filename, options); } ReadResult readImageStream(const std::string& filename, const osgDB::ReaderWriter::Options * options) const { - osg::notify(osg::INFO) << "ReaderWriterFFmpeg::readImage " << filename << std::endl; + osg::notify(osg::INFO) << "ReaderWriterDirectShow::readImage " << filename << std::endl; const std::string path = osgDB::containsServerAddress(filename) ? filename : osgDB::findDataFile(filename, options);