- Update `audio/flacon' to version 3.1.1

- Add upstream patch to fix sporadic crash on program's start-up
  due to notorious C++ "static initialization order fiasco" [*]

Because GitHub releases (tarballs) are not fetched with correct modification
time, set TIMESTAMP to 1502219275 which corresponds to commit 8f81f61 tagged
as this release.

[*] https://isocpp.org/wiki/faq/ctors#static-init-order
This commit is contained in:
Alexey Dokuchaev 2017-08-25 18:14:00 +00:00
parent 1196d221a1
commit bbcb4ff76c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=448724
3 changed files with 66 additions and 4 deletions

View file

@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= flacon
PORTVERSION= 3.0.0
PORTVERSION= 3.1.1
DISTVERSIONPREFIX= v
CATEGORIES= audio

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1497981519
SHA256 (flacon-flacon-v3.0.0_GH0.tar.gz) = 5349fdc29c6cb173e7d40260e7ea4ba13ae39f4a144c22028fbfa132ceef5bb3
SIZE (flacon-flacon-v3.0.0_GH0.tar.gz) = 430724
TIMESTAMP = 1502219275
SHA256 (flacon-flacon-v3.1.1_GH0.tar.gz) = ca5bd24ba61fc06a39e95b4b7fda188af437ad3eff666b55071895bde11bd15a
SIZE (flacon-flacon-v3.1.1_GH0.tar.gz) = 431743

View file

@ -0,0 +1,62 @@
diff --git a/formats/format.cpp b/formats/format.cpp
index 53f7ed0..89abaf9 100644
--- formats/format.cpp.orig
+++ formats/format.cpp
@@ -32,7 +32,14 @@
#include <QByteArray>
#include <QFile>
-AudioFormatList AudioFormat::mAllFormats;
+/************************************************
+ *
+ ************************************************/
+AudioFormatList &formatList()
+{
+ static AudioFormatList *afl = new AudioFormatList();
+ return *afl;
+}
/************************************************
@@ -43,9 +50,9 @@ bool AudioFormat::registerFormat(const AudioFormat &f)
// Some formats can be embedded as a chunk of RIFF stream.
// So the WAV format should be last and be checked in the last turn.
if (f.ext() == "wav")
- mAllFormats.append(&f);
+ formatList().append(&f);
else
- mAllFormats.insert(0, &f);
+ formatList().insert(0, &f);
return true;
}
@@ -71,7 +78,7 @@ AudioFormat::~AudioFormat()
************************************************/
const AudioFormatList &AudioFormat::allFormats()
{
- return mAllFormats;
+ return formatList();
}
diff --git a/formats/format.h b/formats/format.h
index b159b7a..0f9fcb6 100644
--- formats/format.h.orig
+++ formats/format.h
@@ -70,8 +70,6 @@ class AudioFormat
protected:
virtual bool checkMagic(const QByteArray &data) const;
-private:
- static QList<const AudioFormat*> mAllFormats;
};
@@ -79,6 +77,6 @@ class AudioFormat
#define REGISTER_FORMAT(FORMAT) \
static FORMAT static_##FORMAT##_Instance; \
- static bool is_##FORMAT##_loaded = AudioFormat::registerFormat(static_##FORMAT##_Instance);
+ static bool is_##FORMAT##_loaded = AudioFormat::registerFormat(static_##FORMAT##_Instance);
#endif // FORMAT_H