diff options
author | Jörg Müller <nexyon@gmail.com> | 2021-08-30 23:36:02 +0300 |
---|---|---|
committer | Jörg Müller <nexyon@gmail.com> | 2021-09-18 22:45:33 +0300 |
commit | bdbc7e12a02e15ad7265dfc1ac21fb6d0016308f (patch) | |
tree | e9b967deb25f77eef348786f5cd22524eef0ec20 /extern/audaspace/src/file/FileManager.cpp | |
parent | 970c928f27106b26ec7cf6afa2316c60384ab4f1 (diff) |
Audaspace: added audio file streams functionality.
On the blender side this commit fixes importing video files with audio
and video streams that do not share the same start time and duration.
Differential Revision: https://developer.blender.org/D12353
Diffstat (limited to 'extern/audaspace/src/file/FileManager.cpp')
-rw-r--r-- | extern/audaspace/src/file/FileManager.cpp | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/extern/audaspace/src/file/FileManager.cpp b/extern/audaspace/src/file/FileManager.cpp index f8ef8deb409..7cbc0318f8c 100644 --- a/extern/audaspace/src/file/FileManager.cpp +++ b/extern/audaspace/src/file/FileManager.cpp @@ -43,13 +43,13 @@ void FileManager::registerOutput(std::shared_ptr<aud::IFileOutput> output) outputs().push_back(output); } -std::shared_ptr<IReader> FileManager::createReader(std::string filename) +std::shared_ptr<IReader> FileManager::createReader(std::string filename, int stream) { for(std::shared_ptr<IFileInput> input : inputs()) { try { - return input->createReader(filename); + return input->createReader(filename, stream); } catch(Exception&) {} } @@ -57,13 +57,41 @@ std::shared_ptr<IReader> FileManager::createReader(std::string filename) AUD_THROW(FileException, "The file couldn't be read with any installed file reader."); } -std::shared_ptr<IReader> FileManager::createReader(std::shared_ptr<Buffer> buffer) +std::shared_ptr<IReader> FileManager::createReader(std::shared_ptr<Buffer> buffer, int stream) { for(std::shared_ptr<IFileInput> input : inputs()) { try { - return input->createReader(buffer); + return input->createReader(buffer, stream); + } + catch(Exception&) {} + } + + AUD_THROW(FileException, "The file couldn't be read with any installed file reader."); +} + +std::vector<StreamInfo> FileManager::queryStreams(std::string filename) +{ + for(std::shared_ptr<IFileInput> input : inputs()) + { + try + { + return input->queryStreams(filename); + } + catch(Exception&) {} + } + + AUD_THROW(FileException, "The file couldn't be read with any installed file reader."); +} + +std::vector<StreamInfo> FileManager::queryStreams(std::shared_ptr<Buffer> buffer) +{ + for(std::shared_ptr<IFileInput> input : inputs()) + { + try + { + return input->queryStreams(buffer); } catch(Exception&) {} } |