diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-07-15 03:36:59 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-07-15 18:03:57 +0200 |
| commit | 21415bdb69a99c4fc36cf4b5e5160a171bb1cad4 (patch) | |
| tree | 46265de6587585d292ac4c97267327af0c359c1c /src/lib/film.cc | |
| parent | 6207d271effad4e691a5155ccdad083e03b010bc (diff) | |
Change Film::examine_and_add_content to take a vector of content.
Diffstat (limited to 'src/lib/film.cc')
| -rw-r--r-- | src/lib/film.cc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 7401d1eac..a1ab3ccf3 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1423,16 +1423,25 @@ Film::content() const * @param disable_audio_analysis true to never do automatic audio analysis, even if it is enabled in configuration. */ void -Film::examine_and_add_content(shared_ptr<Content> content, bool disable_audio_analysis) +Film::examine_and_add_content(vector<shared_ptr<Content>> const& content, bool disable_audio_analysis) { - if (dynamic_pointer_cast<FFmpegContent>(content) && _directory) { - run_ffprobe(content->path(0), file("ffprobe.log")); + if (content.empty()) { + return; + } + + if (dynamic_pointer_cast<FFmpegContent>(content[0]) && _directory) { + run_ffprobe(content[0]->path(0), file("ffprobe.log")); } - auto j = make_shared<ExamineContentJob>(shared_from_this(), vector<shared_ptr<Content>>{content}, false); + auto j = make_shared<ExamineContentJob>(shared_from_this(), content, false); + + vector<weak_ptr<Content>> weak_content; + for (auto i: content) { + weak_content.push_back(i); + } _job_connections.push_back( - j->Finished.connect(bind(&Film::maybe_add_content, this, weak_ptr<Job>(j), vector<weak_ptr<Content>>{weak_ptr<Content>(content)}, disable_audio_analysis)) + j->Finished.connect(bind(&Film::maybe_add_content, this, weak_ptr<Job>(j), weak_content, disable_audio_analysis)) ); JobManager::instance()->add(j); |
