From 6ac4c939aaea894f1bb4523c8d6ec7d5b93d9236 Mon Sep 17 00:00:00 2001 From: Jakob Gahde Date: Tue, 25 Oct 2022 01:23:13 +0200 Subject: [PATCH] Fix truncated playback for converted audio clips on Windows --- app/src/actioncommands.cpp | 6 ++---- core_lib/src/movieimporter.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/src/actioncommands.cpp b/app/src/actioncommands.cpp index 02a4d77ba2..173628e354 100644 --- a/app/src/actioncommands.cpp +++ b/app/src/actioncommands.cpp @@ -177,12 +177,10 @@ Status ActionCommands::importSound(FileType type) { st = Status::CANCELED; } - else if (strSoundFile.endsWith(".wav")) - { - st = mEditor->sound()->loadSound(key, strSoundFile); - } else { + // Convert even if it already is a WAV file to strip metadata that the + // DirectShow media player backend on Windows can't handle st = convertSoundToWav(strSoundFile); } diff --git a/core_lib/src/movieimporter.cpp b/core_lib/src/movieimporter.cpp index 95dd9d9ae1..6767f6f93f 100644 --- a/core_lib/src/movieimporter.cpp +++ b/core_lib/src/movieimporter.cpp @@ -342,7 +342,7 @@ Status MovieImporter::importMovieAudio(const QString& filePath, std::functionpath()).filePath("audio.wav"); - QStringList args{ "-i", filePath, audioPath }; + QStringList args{ "-i", filePath, "-map_metadata", "-1", "-bitexact", audioPath }; status = MovieExporter::executeFFmpeg(ffmpegLocation(), args, [&progress, this] (int frame) { Q_UNUSED(frame)