From 2bbed6c5a045033c17d39693665d122239f9d78c Mon Sep 17 00:00:00 2001 From: wangqr Date: Thu, 6 Jun 2019 16:32:26 -0400 Subject: [PATCH] Load audio when video is successfully loaded Fix bug introduced in 8f40ca44ce8d881d0e7dea967583990a084e9bff --- src/project.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/project.cpp b/src/project.cpp index b8e9c73b0..23107db2b 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -505,6 +505,9 @@ void Project::LoadList(std::vector const& files) { subs.clear(); } + if (!audio.empty()) + DoLoadAudio(audio, false); + if (!video.empty() && DoLoadVideo(video)) { double dar = video_provider->GetDAR(); if (dar > 0) @@ -520,12 +523,11 @@ void Project::LoadList(std::vector const& files) { LoadTimecodes(timecodes); if (!keyframes.empty()) LoadKeyframes(keyframes); - } - if (!audio.empty()) - DoLoadAudio(audio, false); - else if (!video.empty() && OPT_GET("Video/Open Audio")->GetBool() && audio_file != video_file) - DoLoadAudio(video_file, true); + // Load audio from video + if (audio.empty() && OPT_GET("Video/Open Audio")->GetBool() && audio_file != video_file) + DoLoadAudio(video_file, true); + } if (!subs.empty()) LoadUnloadFiles(properties);