[proaudio] proaudio/proaudio: [3017] Loudness is back to the future! |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/proaudio Archives
]
Revision: 3017
Author: dominique
Date: 2016-11-17 12:13:24 +0100 (Thu, 17 Nov 2016)
Log Message:
-----------
Loudness is back to the future!
Added Paths:
-----------
trunk/overlays/proaudio/media-sound/loudness/
trunk/overlays/proaudio/media-sound/loudness/ChangeLog
trunk/overlays/proaudio/media-sound/loudness/Manifest
trunk/overlays/proaudio/media-sound/loudness/files/
trunk/overlays/proaudio/media-sound/loudness/files/ffmpeg_input_buffer_dyn_alloc.patch
trunk/overlays/proaudio/media-sound/loudness/files/id3tag_version.patch
trunk/overlays/proaudio/media-sound/loudness/files/install_all.patch
trunk/overlays/proaudio/media-sound/loudness/files/unbuffered_stdout_err.patch
trunk/overlays/proaudio/media-sound/loudness/loudness-9999.ebuild
trunk/overlays/proaudio/media-sound/loudness/metadata.xml
Added: trunk/overlays/proaudio/media-sound/loudness/ChangeLog
===================================================================
--- trunk/overlays/proaudio/media-sound/loudness/ChangeLog (rev 0)
+++ trunk/overlays/proaudio/media-sound/loudness/ChangeLog 2016-11-17 11:13:24 UTC (rev 3017)
@@ -0,0 +1,38 @@
+# ChangeLog for media-sound/loudness
+# Copyright 1999-2016 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+ 17 Nov 2016; Dominique Michel <dominique_libre@xxxxxxxxxxxxxxx>
+ loudness is loudness again
++ files/ffmpeg_input_buffer_dyn_alloc.patch: sample dyn allocated buffer
++ files/id3tag_version.patch: don't change id3 tag version when writing file
++ files/install_all.patch: install the software
++ files/unbuffered_stdout_err.patch: fix issue with pipes
+ loudness-9999.ebuild: move libebur to media-libs/libebur128;
+ use cmake multilib; new USE flags; FIXME: configure work in automatic,
+ which doesn't follow gentoo policy.
+
+ 09 Mar 2013; Dominique Michel <dominique_libre@xxxxxxxxxxxxxxx>
+ +metadata.xml: initial file
+ loudness-9999.ebuild: Moved AT depends to dev-qt/*
+
+*loudness-9999 (25 Mar 2012)
+
+ 25 Mar 2012; Emery Hemingway <emery@xxxxxxxxxxx> +loudness-9999.ebuild:
+ r128-scanner is now loudness
+
+*r128-scanner-0.4.0 (11 May 2011)
+
+ 11 May 2011; Emery Hemingway <emery@xxxxxxxxx> +r128-scanner-0.4.0.ebuild:
+ Renamed libebur128 to r128-scanner, as that is now the only binary we
+ install.
+
+*libebur128-0.3.2-r1 (09 Apr 2011)
+
+ 09 Apr 2011; Emery Hemingway <emery@xxxxxxxxx> -libebur128-0.3.2.ebuild,
+ +libebur128-0.3.2-r1.ebuild:
+ Fixed embarrassing install path.
+
+ 09 Apr 2011; Emery Hemingway <emery@xxxxxxxxx> libebur128-0.3.2.ebuild:
+ New package.
+
Added: trunk/overlays/proaudio/media-sound/loudness/Manifest
===================================================================
--- trunk/overlays/proaudio/media-sound/loudness/Manifest (rev 0)
+++ trunk/overlays/proaudio/media-sound/loudness/Manifest 2016-11-17 11:13:24 UTC (rev 3017)
@@ -0,0 +1,7 @@
+AUX ffmpeg_input_buffer_dyn_alloc.patch 2990 SHA256 a40c5b28afe8cc85dca1ee8562b143c7fcabc0274717f92fe97c9cf64187fa65 SHA512 8cf49d04dd85e4b99e920be1085ae8338c195a2af23547cc7582694a39b0d9f40f3182d883f5b8edd500c34e99e2c6f6db0dd6bd0f1a64ed8dc1cabccf3fb2f2 WHIRLPOOL 5e124e896cfb6c3d49ec983ee9faa1b40e8cc7e60b84835e8709be64c7f925e7007c141274529d7bd254571d5d1516550b96592f68f556142783ac692b94de7d
+AUX id3tag_version.patch 2027 SHA256 9e84019f346771a4d343a43b9f95fb26cda5240878d6e660d8025090781e8ee3 SHA512 4fc0ba06aa9f92a038a4bdc2e7d1c3c23748af4273b1f8e19f20f433837e13da347fe6bee68fba23f811bcf5117ca4f0d5321910a579ccef33842efea126b923 WHIRLPOOL 4aa9c2f8ba33bc86812746deef046de8ff08609b6119255d3df43fae6c4f1dede882ab7aee39e0faa47df467d0f1ea4aa78b8ab20b73ed1fcbdacc7c188c5dfb
+AUX install_all.patch 5239 SHA256 f53a36d43c9c0d38d61d952c9f60ea3849a89be8decf8f3599d24d372004edbb SHA512 d6bcf4be39bc650b1d2c9c69c30a51d4e9709cb1ce8d71aec939f7b1683c936986b38288888d0adcd3e45ad5b0d7e0e11d2257fa749270729db45d56a755f345 WHIRLPOOL 670ca7256109da015b2629f281b9fcd7f2715757e4fb59a8bed8bb93df461cb6698ceae603c66c564e63c558bbd9bace72b9a9923ba3ff70ee6cd9f8586ce2ff
+AUX unbuffered_stdout_err.patch 1870 SHA256 fdee2c057dd9711be7fef19ca9bc64ba49ae8657c9ec9b63bacd75f6cdf2e8cf SHA512 0953eccf3d42965e36fb29ae100bdfa035e1b92b23417612eb7fd750c435a497d3a2dfcba9714f3d5283f819de1fe9c1611542ba201ed63c89b34fe75e1b4b41 WHIRLPOOL ea304a57556f9dcaf3e6ebff148eb76211b0cfad21a0693c90588f30576361c946d56cdb2a9a18b95a48b9b3c76e568beaa82af477fdb655dfcdb63b17acfaef
+EBUILD loudness-9999.ebuild 1881 SHA256 59bcf568b07fa33414e214b461a300a5128037788d7892c1414e60c476bcc1ee SHA512 b76c03534fca6b2c1a42eacdb482c32a4ae3314b3654c0318567f16fc2c0463c51d570f111e9c44abfe6364193fec3a5f7a09fc30297119eba6b24c8ccb165a1 WHIRLPOOL dc12d39469e163ef90c9bc2c12c699feac75edb9df1bbb91011169285ffa0bfca5cccab43cd011b7bedb7301470e14cd15c92a1d3f503b1e6b053e931d1eeaf8
+MISC ChangeLog 1397 SHA256 e21a2a2c80a9142b92c22f20ca9d19223793be2f644e8ad0280bafca5b080455 SHA512 f20338580d90bc6a5d9bd363fff4730a9cfbf243b0366d9864b712dbabc66e06b9031902b2f31479f88ccd45daef6bd24e2203e02c3d15a669798596c1ebe765 WHIRLPOOL df2a5f4b4edc50874b0a725245ddb80f2aff865949fa37fc9f67c12bfcd5d4eb41a3dc17a6ea501b91dcdf4cc9572cfa327123feeacbde578c200fb44a905d22
+MISC metadata.xml 326 SHA256 cf7fb38e5e03a62f656412c9f6b9c8d458404c144a6e8d75982219de89be8397 SHA512 96ffcd433d561ea4a0fffa2319727d60752642b1924a2a64059a40bb006f8b29bc09ef0ecedfc731a35002ea0c1b3a8c2208b650511b9c5402368380add8b193 WHIRLPOOL 5788090a6c5adcc2d7335480ba1e581ae34121c11b4560994b9fa56e0648c5e9ff3eab63a0cf738eed6130a295b531719632adedc851ccd95337d08336900d75
Added: trunk/overlays/proaudio/media-sound/loudness/files/ffmpeg_input_buffer_dyn_alloc.patch
===================================================================
--- trunk/overlays/proaudio/media-sound/loudness/files/ffmpeg_input_buffer_dyn_alloc.patch (rev 0)
+++ trunk/overlays/proaudio/media-sound/loudness/files/ffmpeg_input_buffer_dyn_alloc.patch 2016-11-17 11:13:24 UTC (rev 3017)
@@ -0,0 +1,88 @@
+From ea38ac45077342359c293be9108d7d2db2d72afd Mon Sep 17 00:00:00 2001
+From: nu774 <honeycomb77@xxxxxxxxx>
+Date: Mon, 16 Dec 2013 10:59:50 +0900
+Subject: [PATCH] input_ffmpeg: allocate sample buffer dynamically
+
+also move call to get_buffer() after read_frames() in order to allow
+reallocation of the frame buffer
+---
+ scanner/inputaudio/ffmpeg/input_ffmpeg.c | 24 +++++++++++++++++-------
+ scanner/scanner-common/scanner-common.c | 2 +-
+ 2 files changed, 18 insertions(+), 8 deletions(-)
+
+diff --git a/scanner/inputaudio/ffmpeg/input_ffmpeg.c b/scanner/inputaudio/ffmpeg/input_ffmpeg.c
+index e460ead..22b01df 100644
+--- a/scanner/inputaudio/ffmpeg/input_ffmpeg.c
++++ b/scanner/inputaudio/ffmpeg/input_ffmpeg.c
+@@ -28,7 +28,8 @@ struct input_handle {
+ int flushing;
+ int got_frame;
+ int packet_left;
+- float buffer[BUFFER_SIZE / 2 + 1];
++ float *buffer;
++ unsigned buffer_size;
+ };
+
+ static unsigned ffmpeg_get_channels(struct input_handle* ih) {
+@@ -45,7 +46,7 @@ static float* ffmpeg_get_buffer(struct input_handle* ih) {
+
+ static struct input_handle* ffmpeg_handle_init() {
+ struct input_handle* ret;
+- ret = malloc(sizeof(struct input_handle));
++ ret = calloc(1, sizeof(struct input_handle));
+
+ return ret;
+ }
+@@ -269,9 +270,15 @@ write_to_buffer: ;
+ int channels = ih->codec_context->channels;
+ // channels = ih->frame->channels;
+
+- if (ih->frame->nb_samples * channels > sizeof ih->buffer) {
+- fprintf(stderr, "buffer too small!\n");
+- return 0;
++ int data_size = nr_frames_read * channels;
++ if (ih->buffer_size < data_size) {
++ float *b = realloc(ih->buffer, data_size * sizeof(float));
++ if (!b) {
++ perror("realloc() failed");
++ return 0;
++ }
++ ih->buffer = b;
++ ih->buffer_size = data_size;
+ }
+
+ int i;
+@@ -350,8 +357,11 @@ static size_t ffmpeg_read_frames(struct input_handle* ih) {
+ }
+
+ static void ffmpeg_free_buffer(struct input_handle* ih) {
+- (void) ih;
+- return;
++ if (ih->buffer) {
++ free(ih->buffer);
++ ih->buffer = 0;
++ ih->buffer_size = 0;
++ }
+ }
+
+ static void ffmpeg_close_file(struct input_handle* ih) {
+diff --git a/scanner/scanner-common/scanner-common.c b/scanner/scanner-common/scanner-common.c
+index b2599d0..bc50822 100644
+--- a/scanner/scanner-common/scanner-common.c
++++ b/scanner/scanner-common/scanner-common.c
+@@ -150,7 +150,6 @@ void init_state_and_scan_work_item(struct filename_list_node *fln, struct scan_o
+
+ result = ops->allocate_buffer(ih);
+ if (result) abort();
+- buffer = ops->get_buffer(ih);
+
+ #ifdef USE_SNDFILE
+ if (opts->decode_file) {
+@@ -173,6 +172,7 @@ void init_state_and_scan_work_item(struct filename_list_node *fln, struct scan_o
+ g_cond_broadcast(progress_cond);
+ g_mutex_unlock(progress_mutex);
+ fd->number_of_elapsed_frames += nr_frames_read;
++ buffer = ops->get_buffer(ih);
+ result = ebur128_add_frames_float(fd->st, buffer, nr_frames_read);
+ #ifdef USE_SNDFILE
+ if (opts->decode_file) {
Added: trunk/overlays/proaudio/media-sound/loudness/files/id3tag_version.patch
===================================================================
--- trunk/overlays/proaudio/media-sound/loudness/files/id3tag_version.patch (rev 0)
+++ trunk/overlays/proaudio/media-sound/loudness/files/id3tag_version.patch 2016-11-17 11:13:24 UTC (rev 3017)
@@ -0,0 +1,45 @@
+From 32fb977d6e0a7550df054f3166727f05658d5d15 Mon Sep 17 00:00:00 2001
+From: nu774 <honeycomb77@xxxxxxxxx>
+Date: Tue, 17 Dec 2013 00:37:32 +0900
+Subject: [PATCH] Don't rewrite to id3v2.4 when input is tagged with id3v2.3
+
+TagLib >= 1.8 supports choice of saving as 2.3/2.4.
+---
+ scanner/scanner-tag/rgtag.cpp | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/scanner/scanner-tag/rgtag.cpp b/scanner/scanner-tag/rgtag.cpp
+index a7e2877..1257c31 100644
+--- a/scanner/scanner-tag/rgtag.cpp
++++ b/scanner/scanner-tag/rgtag.cpp
+@@ -139,6 +139,7 @@ static bool tag_id3v2(const char* filename,
+ struct gain_data_strings* gds) {
+ TagLib::MPEG::File f(CAST_FILENAME filename);
+ TagLib::ID3v2::Tag* id3v2tag = f.ID3v2Tag(true);
++ TagLib::uint version = id3v2tag->header()->majorVersion();
+
+ while (clear_txxx_tag(id3v2tag, TagLib::String("replaygain_album_gain").upper()));
+ while (clear_txxx_tag(id3v2tag, TagLib::String("replaygain_album_peak").upper()));
+@@ -148,14 +149,19 @@ static bool tag_id3v2(const char* filename,
+ while (clear_rva2_tag(id3v2tag, TagLib::String("track").upper()));
+ set_txxx_tag(id3v2tag, "replaygain_track_gain", gds->track_gain);
+ set_txxx_tag(id3v2tag, "replaygain_track_peak", gds->track_peak);
+- set_rva2_tag(id3v2tag, "track", gd->track_gain, gd->track_peak);
++ if (version == 4)
++ set_rva2_tag(id3v2tag, "track", gd->track_gain, gd->track_peak);
+ if (gd->album_mode) {
+ set_txxx_tag(id3v2tag, "replaygain_album_gain", gds->album_gain);
+ set_txxx_tag(id3v2tag, "replaygain_album_peak", gds->album_peak);
+- set_rva2_tag(id3v2tag, "album", gd->album_gain, gd->album_peak);
++ if (version == 4)
++ set_rva2_tag(id3v2tag, "album", gd->album_gain, gd->album_peak);
+ }
+-
++#if TAGLIB_MAJOR_VERSION > 1 || TAGLIB_MINOR_VERSION > 7
++ return !f.save(TagLib::MPEG::File::ID3v2, false, version);
++#else
+ return !f.save(TagLib::MPEG::File::ID3v2, false);
++#endif
+ }
+
+ static bool has_tag_id3v2(const char* filename) {
Added: trunk/overlays/proaudio/media-sound/loudness/files/install_all.patch
===================================================================
--- trunk/overlays/proaudio/media-sound/loudness/files/install_all.patch (rev 0)
+++ trunk/overlays/proaudio/media-sound/loudness/files/install_all.patch 2016-11-17 11:13:24 UTC (rev 3017)
@@ -0,0 +1,125 @@
+From 15dcd54982f4ae3b6fd691ac22937a0720bfe873 Mon Sep 17 00:00:00 2001
+From: Shani H Pribadi <shanipribadi@xxxxxxx>
+Date: Wed, 18 Dec 2013 04:26:45 +0700
+Subject: [PATCH] add install targets
+
+---
+ scanner/CMakeLists.txt | 3 +++
+ scanner/inputaudio/CMakeLists.txt | 2 ++
+ scanner/inputaudio/ffmpeg/CMakeLists.txt | 1 +
+ scanner/inputaudio/gstreamer/CMakeLists.txt | 1 +
+ scanner/inputaudio/mpg123/CMakeLists.txt | 1 +
+ scanner/inputaudio/sndfile/CMakeLists.txt | 1 +
+ scanner/scanner-common/CMakeLists.txt | 1 +
+ scanner/scanner-drop-gtk/CMakeLists.txt | 2 ++
+ scanner/scanner-drop-qt/CMakeLists.txt | 2 ++
+ scanner/scanner-tag/CMakeLists.txt | 2 ++
+ 11 files changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/scanner/CMakeLists.txt b/scanner/CMakeLists.txt
+index 14e87bb..711e3fc 100644
+--- a/scanner/CMakeLists.txt
++++ b/scanner/CMakeLists.txt
+@@ -64,4 +64,7 @@ if(GLIB20_FOUND AND GTHREAD20_FOUND AND NOT DISABLE_GLIB20)
+ set_property(TARGET loudness APPEND PROPERTY
+ COMPILE_DEFINITIONS "USE_TAGLIB")
+ endif()
++
++ install(TARGETS scanner-lib DESTINATION lib)
++ install(TARGETS loudness DESTINATION bin)
+ endif()
+diff --git a/scanner/inputaudio/CMakeLists.txt b/scanner/inputaudio/CMakeLists.txt
+index 774e7ec..5a0c4f5 100644
+--- a/scanner/inputaudio/CMakeLists.txt
++++ b/scanner/inputaudio/CMakeLists.txt
+@@ -21,4 +21,6 @@ if(GMODULE20_FOUND AND NOT DISABLE_GLIB20)
+ add_library(input input)
+
+ target_link_libraries(input ${GMODULE20_LIBRARIES})
++
++ install(TARGETS input DESTINATION lib)
+ endif()
+diff --git a/scanner/inputaudio/ffmpeg/CMakeLists.txt b/scanner/inputaudio/ffmpeg/CMakeLists.txt
+index dcfe861..98b2d7f 100644
+--- a/scanner/inputaudio/ffmpeg/CMakeLists.txt
++++ b/scanner/inputaudio/ffmpeg/CMakeLists.txt
+@@ -45,4 +45,5 @@ if(LIBAVFORMAT_FOUND AND GMODULE20_FOUND AND
+ set_target_properties(input_ffmpeg PROPERTIES
+ LINK_FLAGS ${INPUT_FFMPEG_LDFLAGS})
+ endif()
++ install(TARGETS input_ffmpeg DESTINATION lib)
+ endif()
+diff --git a/scanner/inputaudio/gstreamer/CMakeLists.txt b/scanner/inputaudio/gstreamer/CMakeLists.txt
+index eab05d3..5d9ceb5 100644
+--- a/scanner/inputaudio/gstreamer/CMakeLists.txt
++++ b/scanner/inputaudio/gstreamer/CMakeLists.txt
+@@ -28,4 +28,5 @@ if(GMODULE20_FOUND AND GSTREAMER_FOUND AND
+ set_target_properties(input_gstreamer PROPERTIES
+ COMPILE_FLAGS ${INPUT_GSTREAMER_CFLAGS}
+ LINK_FLAGS ${INPUT_GSTREAMER_LDFLAGS})
++ install(TARGETS input_gstreamer DESTINATION lib)
+ endif()
+diff --git a/scanner/inputaudio/mpg123/CMakeLists.txt b/scanner/inputaudio/mpg123/CMakeLists.txt
+index 76baeff..1666310 100644
+--- a/scanner/inputaudio/mpg123/CMakeLists.txt
++++ b/scanner/inputaudio/mpg123/CMakeLists.txt
+@@ -26,4 +26,5 @@ if(GMODULE20_FOUND AND MPG123_FOUND AND
+ set_target_properties(input_mpg123 PROPERTIES
+ COMPILE_FLAGS ${INPUT_MPG123_CFLAGS}
+ LINK_FLAGS ${INPUT_MPG123_LDFLAGS})
++ install(TARGETS input_mpg123 DESTINATION lib)
+ endif()
+diff --git a/scanner/inputaudio/sndfile/CMakeLists.txt b/scanner/inputaudio/sndfile/CMakeLists.txt
+index 16cc255..8366641 100644
+--- a/scanner/inputaudio/sndfile/CMakeLists.txt
++++ b/scanner/inputaudio/sndfile/CMakeLists.txt
+@@ -31,4 +31,5 @@ if(GMODULE20_FOUND AND SNDFILE_FOUND AND
+ set_target_properties(input_sndfile PROPERTIES
+ LINK_FLAGS ${INPUT_SNDFILE_LDFLAGS})
+ endif()
++ install(TARGETS input_sndfile DESTINATION lib)
+ endif()
+diff --git a/scanner/scanner-common/CMakeLists.txt b/scanner/scanner-common/CMakeLists.txt
+index 2496a1b..2b560be 100644
+--- a/scanner/scanner-common/CMakeLists.txt
++++ b/scanner/scanner-common/CMakeLists.txt
+@@ -14,3 +14,4 @@ endif()
+ if(SUMMARY_SPEEXDSP_FOUND AND NOT DISABLE_SPEEXDSP)
+ add_definitions(-DUSE_SPEEX_RESAMPLER)
+ endif()
++install(TARGETS scanner-common DESTINATION lib)
+diff --git a/scanner/scanner-drop-gtk/CMakeLists.txt b/scanner/scanner-drop-gtk/CMakeLists.txt
+index 9929a8a..c821ee5 100644
+--- a/scanner/scanner-drop-gtk/CMakeLists.txt
++++ b/scanner/scanner-drop-gtk/CMakeLists.txt
+@@ -21,5 +21,7 @@ if(TARGET scanner-tag)
+ ${GLIB20_LIBRARIES}
+ ${GTHREAD20_LIBRARIES}
+ ${RSVG2_LIBRARIES})
++
++ install(TARGETS loudness-drop-gtk DESTINATION bin)
+ endif()
+ endif()
+diff --git a/scanner/scanner-drop-qt/CMakeLists.txt b/scanner/scanner-drop-qt/CMakeLists.txt
+index 50b081b..750376b 100644
+--- a/scanner/scanner-drop-qt/CMakeLists.txt
++++ b/scanner/scanner-drop-qt/CMakeLists.txt
+@@ -16,5 +16,7 @@ if(TARGET scanner-tag)
+ ${QT_QTCORE_LIBRARY}
+ ${QT_QTGUI_LIBRARY}
+ ${QT_QTSVG_LIBRARY})
++
++ install(TARGETS loudness-drop-qt DESTINATION bin)
+ endif()
+ endif()
+diff --git a/scanner/scanner-tag/CMakeLists.txt b/scanner/scanner-tag/CMakeLists.txt
+index 77f6bc4..25a27c8 100644
+--- a/scanner/scanner-tag/CMakeLists.txt
++++ b/scanner/scanner-tag/CMakeLists.txt
+@@ -9,4 +9,6 @@ if(TAGLIB_FOUND AND NOT DISABLE_TAGLIB)
+ add_library(scanner-tag scanner-tag rgtag)
+ include_directories(${TAGLIB_INCLUDE_DIRS})
+ target_link_libraries(scanner-tag scanner-common ${TAGLIB_LIBRARIES})
++ install(TARGETS scanner-tag DESTINATION lib)
+ endif()
++
Added: trunk/overlays/proaudio/media-sound/loudness/files/unbuffered_stdout_err.patch
===================================================================
--- trunk/overlays/proaudio/media-sound/loudness/files/unbuffered_stdout_err.patch (rev 0)
+++ trunk/overlays/proaudio/media-sound/loudness/files/unbuffered_stdout_err.patch 2016-11-17 11:13:24 UTC (rev 3017)
@@ -0,0 +1,61 @@
+From cae846d97df15dd08dbcf9de22ef668b62938f65 Mon Sep 17 00:00:00 2001
+From: nu774 <honeycomb77@xxxxxxxxx>
+Date: Mon, 16 Dec 2013 23:53:31 +0900
+Subject: [PATCH] set stdout/stderr to be unbuffered when they are not
+ connected to a file
+
+This fixes somewhat jumbled output due to mixed usage of stdout and
+stderr without proper calls to fflush() and letting stdio choose the
+default buffering strategy.
+On win32, pipes are often used instead pty (since there's no pty on win32),
+therefore this issue has higher possibility to appear. For example,
+running scanner in psuedo terminal application such as mintty is
+enough to reproduce the issue.
+unbuffered mode is a simple way to ensure output order to be
+always preserved, at the expence of tiny I/O overhead that should be
+negligible.
+---
+ scanner/scanner.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/scanner/scanner.c b/scanner/scanner.c
+index 276f8fc..2434c74 100644
+--- a/scanner/scanner.c
++++ b/scanner/scanner.c
+@@ -1,7 +1,12 @@
+ /* See COPYING file for copyright and license details. */
+
++#include <sys/types.h>
++#include <sys/stat.h>
+ #ifdef G_OS_WIN32
+ #include <windows.h>
++#include <io.h>
++#else
++#include <unistd.h>
+ #endif
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -119,6 +124,13 @@ enum modes
+ LOUDNESS_MODE_DUMP
+ };
+
++void set_buffering_mode(FILE *fp)
++{
++ struct stat stb;
++ if (fstat(fileno(fp), &stb) == 0 && (stb.st_mode & S_IFMT) != S_IFREG)
++ setbuf(fp, 0);
++}
++
+ int main(int argc, char *argv[])
+ {
+ GSList *errors = NULL, *files = NULL;
+@@ -129,6 +141,9 @@ int main(int argc, char *argv[])
+ print_help();
+ exit(EXIT_FAILURE);
+ }
++ set_buffering_mode(stdout);
++ set_buffering_mode(stderr);
++
+ if (!strcmp(argv[1], "scan")) {
+ mode = LOUDNESS_MODE_SCAN;
+ mode_parsed = loudness_scan_parse(&argc, &argv);
Added: trunk/overlays/proaudio/media-sound/loudness/loudness-9999.ebuild
===================================================================
--- trunk/overlays/proaudio/media-sound/loudness/loudness-9999.ebuild (rev 0)
+++ trunk/overlays/proaudio/media-sound/loudness/loudness-9999.ebuild 2016-11-17 11:13:24 UTC (rev 3017)
@@ -0,0 +1,69 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=6
+
+inherit eutils cmake-multilib git-r3
+
+MY_PN="${PN}-scanner"
+
+DESCRIPTION="A library implementing the EBU R128 loudness standard."
+HOMEPAGE="https://github.com/jiixyj/${MY_PN}"
+EGIT_REPO_URI="https://github.com/jiixyj/${MY_PN}.git"
+LICENSE="MIT"
+
+SLOT="0"
+KEYWORDS=""
+
+IUSE="ffmpeg gstreamer gtk musepack mp3 qt4 rsvg sndfile speex taglib"
+
+DEPEND="dev-libs/glib:2
+ >=media-libs/libebur128-9999
+ qt4? ( dev-qt/qtgui:4
+ dev-qt/qtsvg:4 )
+ gtk? ( x11-libs/gtk+:2 )
+ ffmpeg? ( virtual/ffmpeg )
+ gstreamer? ( media-libs/gstreamer:1.0 )
+ musepack? ( media-sound/musepack-tools )
+ mp3? ( media-sound/mpg123 )
+ rsvg? ( gnome-base/librsvg )
+ sndfile? ( media-libs/libsndfile )
+ speex? ( media-libs/speex )
+ taglib? ( media-libs/taglib )"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}/install_all.patch"
+ "${FILESDIR}/ffmpeg_input_buffer_dyn_alloc.patch"
+ "${FILESDIR}/id3tag_version.patch"
+ "${FILESDIR}/unbuffered_stdout_err.patch" )
+
+# FIXME: The build config system is a calamity.
+#src_configure() {
+# local mycmakeargs=(
+# -DENABLE_INTERNAL_QUEUE_H=OFF
+# -DDISABLE_SPEEXDSP=OFF
+# -DDISABLE_GLIB20=OFF
+# -DDISABLE_SPEEXDSP=$(usex speex)
+# -DDISABLE_SNDFILE=$(usex sndfile)
+# -DDISABLE_TAGLIB=$(usex taglib)
+# -DDISABLE_MPG123=$(usex mp3)
+# -DDISABLE_MPCDEC=$(usex musepack)
+# -DDISABLE_GSTREAMER=$(usex gstreamer)
+# -DDISABLE_FFMPEG=$(usex ffmpeg)
+# -DDISABLE_RSVG2=$(usex rsvg)
+# -DDISABLE_GTK2=$(usex gtk)
+# -DDISABLE_QT4=$(usex qt4)
+# )
+# cmake-utils_src_configure
+#}
+
+# remove libebur128 to avoid file collisions
+multilib_src_install() {
+ cmake-utils_src_install
+ rm -rf "${D}/usr/include"
+ rm -f "${D}/usr/lib/libebur128.a"
+ rm -f "${D}/usr/lib/libebur128.so"
+ rm -f "${D}/usr/lib/libebur128.so.1"
+ rm -f "${D}/usr/lib/libebur128.so.1.0.1"
+}
Added: trunk/overlays/proaudio/media-sound/loudness/metadata.xml
===================================================================
--- trunk/overlays/proaudio/media-sound/loudness/metadata.xml (rev 0)
+++ trunk/overlays/proaudio/media-sound/loudness/metadata.xml 2016-11-17 11:13:24 UTC (rev 3017)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>proaudio@xxxxxxxxxxxxx</email>
+ <name>pro-audio overlay team</name>
+ </maintainer>
+ <use>
+ <flag name='rsvg'>Add librsvg support</flag>
+ </use>
+</pkgmetadata>