Store the loaded audio file as a path relative to the subtitles, as is done with video

Originally committed to SVN as r6710.
This commit is contained in:
Thomas Goyne 2012-04-21 15:13:40 +00:00
parent 15eb4dc29d
commit 3c31c1a17a
2 changed files with 3 additions and 2 deletions

View file

@ -56,6 +56,7 @@
#include "main.h"
#include "selection_controller.h"
#include "standard_paths.h"
#include "utils.h"
#include "video_context.h"
AudioController::AudioController(agi::Context *context)
@ -311,7 +312,7 @@ void AudioController::OnSubtitlesSave()
{
if (IsAudioOpen())
{
context->ass->SetScriptInfo("Audio URI", audio_url);
context->ass->SetScriptInfo("Audio URI", MakeRelativePath(audio_url, context->ass->filename));
}
else
{

View file

@ -645,7 +645,7 @@ void FrameMain::OnSubtitlesOpen() {
wxString curSubsVideo = DecodeRelativePath(context->ass->GetScriptInfo("Video File"), context->ass->filename);
wxString curSubsVFR = DecodeRelativePath(context->ass->GetScriptInfo("VFR File"), context->ass->filename);
wxString curSubsKeyframes = DecodeRelativePath(context->ass->GetScriptInfo("Keyframes File"), context->ass->filename);
wxString curSubsAudio = context->ass->GetScriptInfo("Audio URI");
wxString curSubsAudio = DecodeRelativePath(context->ass->GetScriptInfo("Audio URI"), context->ass->filename);
bool videoChanged = !blockVideoLoad && curSubsVideo != context->videoController->GetVideoName();
bool timecodesChanged = curSubsVFR != context->videoController->GetTimecodesName();