Load audio when video is successfully loaded

Fix bug introduced in 8f40ca44ce
This commit is contained in:
wangqr 2019-06-06 16:32:26 -04:00
parent 592250eeaa
commit 2bbed6c5a0
1 changed files with 7 additions and 5 deletions

View File

@ -505,6 +505,9 @@ void Project::LoadList(std::vector<agi::fs::path> const& files) {
subs.clear(); subs.clear();
} }
if (!audio.empty())
DoLoadAudio(audio, false);
if (!video.empty() && DoLoadVideo(video)) { if (!video.empty() && DoLoadVideo(video)) {
double dar = video_provider->GetDAR(); double dar = video_provider->GetDAR();
if (dar > 0) if (dar > 0)
@ -520,12 +523,11 @@ void Project::LoadList(std::vector<agi::fs::path> const& files) {
LoadTimecodes(timecodes); LoadTimecodes(timecodes);
if (!keyframes.empty()) if (!keyframes.empty())
LoadKeyframes(keyframes); LoadKeyframes(keyframes);
}
if (!audio.empty()) // Load audio from video
DoLoadAudio(audio, false); if (audio.empty() && OPT_GET("Video/Open Audio")->GetBool() && audio_file != video_file)
else if (!video.empty() && OPT_GET("Video/Open Audio")->GetBool() && audio_file != video_file) DoLoadAudio(video_file, true);
DoLoadAudio(video_file, true); }
if (!subs.empty()) if (!subs.empty())
LoadUnloadFiles(properties); LoadUnloadFiles(properties);