Try auto loading audio from video only when actually loading a video

If the user drop some files into Aegisub, we try to load sub, video,
audio, etc from them. When "Automatically open audio when opening
video" is checked in config, we try to load audio from the path of
the video. This should only be done if the video is newly loaded. So
we should never try to load audio from video if the user is just
opening a subtitle.

See https://github.com/Aegisub/Aegisub/issues/121#issuecomment-498489847
This commit is contained in:
wangqr 2019-06-06 14:31:07 -04:00
parent f776db2d2b
commit 8f40ca44ce

View file

@ -524,7 +524,7 @@ void Project::LoadList(std::vector<agi::fs::path> const& files) {
if (!audio.empty())
DoLoadAudio(audio, false);
else if (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);
if (!subs.empty())