From 820078bb15493134903cafb3821f3a9fd4111c72 Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 18 Nov 2016 17:58:47 +0100 Subject: [PATCH] Fix saving MP3/FLAC when save saveFilePath() set --- mediafileinfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mediafileinfo.cpp b/mediafileinfo.cpp index a527a93..bc20da9 100644 --- a/mediafileinfo.cpp +++ b/mediafileinfo.cpp @@ -1481,7 +1481,7 @@ void MediaFileInfo::invalidated() */ void MediaFileInfo::makeMp3File() { - static const string context("making MP3 file"); + static const string context("making MP3/FLAC file"); // there's no need to rewrite the complete file if there are no ID3v2 tags present or to be written if(!isForcingRewrite() && m_id3v2Tags.empty() && m_actualId3v2TagOffsets.empty() && m_saveFilePath.empty() && m_containerFormat != ContainerFormat::Flac) { if(m_actualExistingId3v1Tag) { @@ -1619,6 +1619,7 @@ void MediaFileInfo::makeMp3File() } else { // open the current file as backupStream and create a new outputStream at the specified "save file path" try { + close(); backupStream.exceptions(ios_base::badbit | ios_base::failbit); backupStream.open(path(), ios_base::in | ios_base::binary); outputStream.open(m_saveFilePath, ios_base::out | ios_base::binary | ios_base::trunc);