From 33a85aa0592ca7dcdcfff990a635d5a0e87c8c7c Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 17 Feb 2020 11:17:21 +1100 Subject: [PATCH 1/2] audiobackend: fixed issue where audio would be appended rather than overwritten on some platforms Despite the fact we don't actually do any reading here, using QFile::WriteOnly on its own will truncate the file to 0 bytes which is undesirable. The documentation says QFile::ReadOnly, Append or NewOnly will prevent this. NewOnly won't work and reads are unnecessary, so Append was used initially. However on some platforms, Append will _only_ allow writing at the end of the file (ignoring the seek() function) meaning bytes won't be written where they're meant to be (this behavior happens on Linux and not on Windows, the platform discrepancy is likely a Qt bug). Using ReadWrite instead, despite not reading anything, prevents truncation and allows for writing not at the end of the file. --- app/render/backend/audio/audiobackend.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/render/backend/audio/audiobackend.cpp b/app/render/backend/audio/audiobackend.cpp index ea2010942..9d4c3eb27 100644 --- a/app/render/backend/audio/audiobackend.cpp +++ b/app/render/backend/audio/audiobackend.cpp @@ -66,13 +66,15 @@ void AudioBackend::ThreadCompletedCache(NodeDependency dep, NodeValueTable data, int out_point = offset + length; QFile f(CachePathName()); - if (f.open(QFile::WriteOnly | QFile::Append)) { + if (f.open(QFile::ReadWrite)) { - if (f.size() < out_point) { - f.resize(out_point); + if (f.size() < out_point && !f.resize(out_point)) { + qCritical() << "Failed to resize file" << CachePathName(); } - f.seek(offset); + if (!f.seek(offset)) { + qCritical() << "Failed to seek file" << CachePathName(); + } // Replace data with this data int copy_length = qMin(length, cached_samples.size()); From 14fe4949ffd923a0d7840565914db2e33482b575 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 17 Feb 2020 11:27:03 +1100 Subject: [PATCH 2/2] travis: don't add ppa that no longer exists --- .travis/before_install.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis/before_install.sh b/.travis/before_install.sh index 20f9388dc..569d5f5bb 100644 --- a/.travis/before_install.sh +++ b/.travis/before_install.sh @@ -8,9 +8,6 @@ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then # FFmpeg 4.x sudo add-apt-repository ppa:jonathonf/ffmpeg-4 -y - # OpenImageIO - sudo add-apt-repository ppa:olive-editor/openimageio -y - # OpenColorIO sudo add-apt-repository ppa:olive-editor/opencolorio -y