Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

Commit

Permalink
Load audio when video is successfully loaded
Browse files Browse the repository at this point in the history
Fix bug introduced in d4e5a3b
  • Loading branch information
wangqr committed Jun 6, 2019
1 parent 69d6b70 commit f586135
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ void Project::LoadList(std::vector<agi::fs::path> const& files) {
subs.clear();
}

if (!audio.empty())
DoLoadAudio(audio, false);

if (!video.empty() && DoLoadVideo(video)) {
double dar = video_provider->GetDAR();
if (dar > 0)
Expand All @@ -520,12 +523,11 @@ void Project::LoadList(std::vector<agi::fs::path> 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);
Expand Down

0 comments on commit f586135

Please sign in to comment.