From 4b6640e6e7f77aabe6d6b678f214dfdc02536f42 Mon Sep 17 00:00:00 2001 From: user597 Date: Thu, 8 Jan 2015 09:18:46 +0100 Subject: [PATCH 1/8] adding flv to audio_extensions --- src/spek-window.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/spek-window.cc b/src/spek-window.cc index 404d483..524ed7c 100644 --- a/src/spek-window.cc +++ b/src/spek-window.cc @@ -196,6 +196,7 @@ static const char *audio_extensions[] = { "au", "dts", "flac", + "flv", "gsm", "m4a", "m4p", From 74800f14b30ee13c5bc08d98e814ebc9c95141f3 Mon Sep 17 00:00:00 2001 From: Vincent A Date: Mon, 25 May 2015 19:51:52 -0700 Subject: [PATCH 2/8] i18n: Update French translation Signed-off-by: Alexander Kojevnikov --- LICENCE.md | 1 + po/fr.po | 43 ++++++++++++++++++++++--------------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/LICENCE.md b/LICENCE.md index 4566b90..35d2935 100644 --- a/LICENCE.md +++ b/LICENCE.md @@ -37,6 +37,7 @@ Translators: * Tero Talvio * Tiago Rinaldi * Toms Zvīnis +* Vincent A * Wasilis Mandratzis * Wouter Bolsterlee * Many more (let me know if you translated Spek and want your full name diff --git a/po/fr.po b/po/fr.po index 8ee1e9d..5a362d6 100644 --- a/po/fr.po +++ b/po/fr.po @@ -4,16 +4,17 @@ # # Translators: # Alexander Kojevnikov , 2011-2012 -# flz , 2011 +# flz , 2011 # FoeNyx , 2011 # PegHorse , 2012 +# Vincent A , 2015 msgid "" msgstr "" "Project-Id-Version: Spek\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-11 10:26-0700\n" -"PO-Revision-Date: 2013-11-20 10:50+0000\n" -"Last-Translator: Alexander Kojevnikov \n" +"POT-Creation-Date: 2014-03-29 13:05-0700\n" +"PO-Revision-Date: 2015-03-25 22:57+0000\n" +"Last-Translator: Vincent A \n" "Language-Team: French (http://www.transifex.com/projects/p/spek/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -145,72 +146,72 @@ msgstr "-00 dB" msgid "Spek - Acoustic Spectrum Analyser" msgstr "Spek - Analyseur de Spectre Acoustique" -#: ../src/spek-window.cc:95 +#: ../src/spek-window.cc:91 msgid "&File" msgstr "&Fichier" -#: ../src/spek-window.cc:101 +#: ../src/spek-window.cc:97 msgid "&Edit" msgstr "É&dition" -#: ../src/spek-window.cc:105 ../src/spek-window.cc:110 +#: ../src/spek-window.cc:101 ../src/spek-window.cc:106 msgid "&Help" msgstr "Aid&e" -#: ../src/spek-window.cc:133 +#: ../src/spek-window.cc:128 msgid "Help" msgstr "Aide" -#: ../src/spek-window.cc:147 +#: ../src/spek-window.cc:141 msgid "A new version of Spek is available, click to download." msgstr "Une nouvelle version de Spek est disponible, cliquez pour la télécharger." #. TRANSLATORS: window title, %s is replaced with the file name -#: ../src/spek-window.cc:185 +#: ../src/spek-window.cc:179 #, c-format msgid "Spek - %s" msgstr "Spek - %s" -#: ../src/spek-window.cc:232 +#: ../src/spek-window.cc:226 msgid "All files" msgstr "Tous les fichiers" -#: ../src/spek-window.cc:234 +#: ../src/spek-window.cc:228 msgid "Audio files" msgstr "Fichiers audio" -#: ../src/spek-window.cc:248 +#: ../src/spek-window.cc:242 msgid "Open File" msgstr "Ouvrir un fichier" -#: ../src/spek-window.cc:270 +#: ../src/spek-window.cc:264 msgid "PNG images" msgstr "Images PNG" -#: ../src/spek-window.cc:276 +#: ../src/spek-window.cc:270 msgid "Save Spectrogram" msgstr "Sauvegarder le spectrogramme" #. Suggested name is .png -#: ../src/spek-window.cc:284 +#: ../src/spek-window.cc:278 msgid "Untitled" msgstr "Sans titre" #. TRANSLATORS: Add your name here -#: ../src/spek-window.cc:331 +#: ../src/spek-window.cc:325 msgid "translator-credits" msgstr "Florent Thoumie\nAlexander Kojevnikov" -#: ../src/spek-window.cc:337 +#: ../src/spek-window.cc:331 msgid "Copyright (c) 2010-2013 Alexander Kojevnikov and contributors" -msgstr "Copyright (c) 2010-2013 Alexander Kojevnikov et contributeurs." +msgstr "Copyright (c) 2010-2015 Alexander Kojevnikov et contributeurs." -#: ../src/spek-window.cc:340 +#: ../src/spek-window.cc:334 msgid "Spek Website" msgstr "Site web de Spek" #. TRANSLATORS: the %s is the package version. -#: ../src/spek.cc:96 +#: ../src/spek.cc:94 #, c-format msgid "Spek version %s" msgstr "Spek version %s" From 0e78642990355eb3e8b5c63f63671fa1e8af2ef0 Mon Sep 17 00:00:00 2001 From: Alexander Kojevnikov Date: Mon, 25 May 2015 20:32:21 -0700 Subject: [PATCH 3/8] Fix a warning --- src/spek-fft.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/spek-fft.h b/src/spek-fft.h index c3ef247..52b7fdf 100644 --- a/src/spek-fft.h +++ b/src/spek-fft.h @@ -35,7 +35,7 @@ class FFTPlan { public: FFTPlan(int nbits) : - nbits(nbits), input_size(1 << nbits), output_size((1 << (nbits - 1)) + 1), + input_size(1 << nbits), output_size((1 << (nbits - 1)) + 1), input(input_size), output(output_size) {} virtual ~FFTPlan() {} @@ -52,7 +52,6 @@ protected: float *get_input() { return this->input.data(); } private: - int nbits; int input_size; int output_size; std::vector input; From 696e28b4680f895faa240aece0817fcbe8438a88 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Sat, 9 Jan 2016 17:25:06 -0800 Subject: [PATCH 4/8] Replace deprecated FFmpeg API --- src/spek-audio.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spek-audio.cc b/src/spek-audio.cc index 7b5d2ba..2f6218a 100644 --- a/src/spek-audio.cc +++ b/src/spek-audio.cc @@ -213,7 +213,7 @@ AudioFileImpl::AudioFileImpl( this->packet.data = nullptr; this->packet.size = 0; this->offset = 0; - this->frame = avcodec_alloc_frame(); + this->frame = av_frame_alloc(); this->buffer_len = 0; this->buffer = nullptr; this->frames_per_interval = 0; @@ -227,7 +227,7 @@ AudioFileImpl::~AudioFileImpl() av_freep(&this->buffer); } if (this->frame) { - avcodec_free_frame(&this->frame); + av_frame_free(&this->frame); } if (this->packet.data) { this->packet.data -= this->offset; @@ -264,7 +264,7 @@ int AudioFileImpl::read() for (;;) { while (this->packet.size > 0) { - avcodec_get_frame_defaults(this->frame); + av_frame_unref(this->frame); auto codec_context = this->format_context->streams[this->audio_stream]->codec; int got_frame = 0; int len = avcodec_decode_audio4(codec_context, this->frame, &got_frame, &this->packet); From 0d60a2d7cb519e810a82bbf71c0b62f9282d707a Mon Sep 17 00:00:00 2001 From: Alexander Kojevnikov Date: Sat, 9 Jan 2016 17:32:37 -0800 Subject: [PATCH 5/8] Bump required lavc version --- configure.ac | 2 +- src/spek-audio.cc | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index cfb839a..d2e8b41 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,7 @@ AM_COND_IF([USE_VALGRIND], [use_valgrind=yes], [use_valgrind=no]) AC_CHECK_LIB(m, log10) PKG_CHECK_MODULES(AVFORMAT, [libavformat >= 53.17]) -PKG_CHECK_MODULES(AVCODEC, [libavcodec >= 53.25]) +PKG_CHECK_MODULES(AVCODEC, [libavcodec >= 55.46]) PKG_CHECK_MODULES(AVUTIL, [libavutil >= 51.17]) AM_OPTIONS_WXCONFIG diff --git a/src/spek-audio.cc b/src/spek-audio.cc index 2f6218a..b7633bc 100644 --- a/src/spek-audio.cc +++ b/src/spek-audio.cc @@ -26,17 +26,6 @@ extern "C" { #include "spek-audio.h" -// TODO: Remove these macros after Debian switches to libav 9. -#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 28, 0) -#define avcodec_free_frame av_freep -#endif -#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 25, 0) -#define AV_CODEC_ID_AAC CODEC_ID_AAC -#define AV_CODEC_ID_MUSEPACK8 CODEC_ID_MUSEPACK8 -#define AV_CODEC_ID_WMAV1 CODEC_ID_WMAV1 -#define AV_CODEC_ID_WMAV2 CODEC_ID_WMAV2 -#endif - class AudioFileImpl : public AudioFile { public: From fdd10bebd9c1dc841b9cd70ff5329e39986b7295 Mon Sep 17 00:00:00 2001 From: Alexander Kojevnikov Date: Sat, 9 Jan 2016 17:35:00 -0800 Subject: [PATCH 6/8] Update authors --- LICENCE.md | 1 + src/spek-window.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/LICENCE.md b/LICENCE.md index 35d2935..b398344 100644 --- a/LICENCE.md +++ b/LICENCE.md @@ -11,6 +11,7 @@ Maintainer: Contributors: +* Andreas Cadhalpun * Colin Watson * Daniel Hams * Fabian Deutsch diff --git a/src/spek-window.cc b/src/spek-window.cc index 524ed7c..66c0032 100644 --- a/src/spek-window.cc +++ b/src/spek-window.cc @@ -314,6 +314,7 @@ void SpekWindow::on_about(wxCommandEvent&) { wxAboutDialogInfo info; info.AddDeveloper("Alexander Kojevnikov"); + info.AddDeveloper("Andreas Cadhalpun"); info.AddDeveloper("Colin Watson"); info.AddDeveloper("Daniel Hams"); info.AddDeveloper("Fabian Deutsch"); From f34188dd9d5d4e307d344e89608cad0c4421edd0 Mon Sep 17 00:00:00 2001 From: Alexander Kojevnikov Date: Sun, 10 Jan 2016 18:59:30 -0800 Subject: [PATCH 7/8] debian: Update to 0.8.2-4 --- dist/debian/changelog | 6 +++++ dist/debian/control | 2 +- dist/debian/patches/ffmpeg_2.9.patch | 34 ++++++++++++++++++++++++++++ dist/debian/patches/series | 1 + 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 dist/debian/patches/ffmpeg_2.9.patch diff --git a/dist/debian/changelog b/dist/debian/changelog index 83ef991..b32c39c 100644 --- a/dist/debian/changelog +++ b/dist/debian/changelog @@ -1,3 +1,9 @@ +spek (0.8.2-4) unstable; urgency=low + + * Fix build with FFmpeg 2.9 (Closes: #803861) + + -- Alexander Kojevnikov Sun, 10 Jan 2016 17:52:24 -0800 + spek (0.8.2-3.2) unstable; urgency=medium * Build using the default GCC. Closes: #751331. diff --git a/dist/debian/control b/dist/debian/control index 97d51c0..411c526 100644 --- a/dist/debian/control +++ b/dist/debian/control @@ -11,7 +11,7 @@ Build-Depends: debhelper (>= 9), libavutil-dev (>= 6:0.8), libwxgtk3.0-dev, wx-common -Standards-Version: 3.9.5 +Standards-Version: 3.9.6 Homepage: http://spek.cc/ Vcs-Git: git://github.com/alexkay/spek.git Vcs-Browser: https://github.com/alexkay/spek diff --git a/dist/debian/patches/ffmpeg_2.9.patch b/dist/debian/patches/ffmpeg_2.9.patch new file mode 100755 index 0000000..e5c493a --- /dev/null +++ b/dist/debian/patches/ffmpeg_2.9.patch @@ -0,0 +1,34 @@ +Description: Replace deprecated FFmpeg API +Author: Andreas Cadhalpun +Last-Update: <2015-11-02> + +--- spek-0.8.2.orig/src/spek-audio.cc ++++ spek-0.8.2/src/spek-audio.cc +@@ -199,7 +199,7 @@ AudioFileImpl::AudioFileImpl( + this->packet.data = nullptr; + this->packet.size = 0; + this->offset = 0; +- this->frame = avcodec_alloc_frame(); ++ this->frame = av_frame_alloc(); + this->buffer_size = 0; + this->buffer = nullptr; + this->frames_per_interval = 0; +@@ -215,7 +215,7 @@ AudioFileImpl::~AudioFileImpl() + if (this->frame) { + // TODO: Remove this check after Debian switches to libav 9. + #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0) +- avcodec_free_frame(&this->frame); ++ av_frame_free(&this->frame); + #else + av_freep(&this->frame); + #endif +@@ -255,7 +255,7 @@ int AudioFileImpl::read() + + for (;;) { + while (this->packet.size > 0) { +- avcodec_get_frame_defaults(this->frame); ++ av_frame_unref(this->frame); + auto codec_context = this->format_context->streams[this->audio_stream]->codec; + int got_frame = 0; + int len = avcodec_decode_audio4(codec_context, this->frame, &got_frame, &this->packet); + diff --git a/dist/debian/patches/series b/dist/debian/patches/series index 8215fd9..a1e29d9 100644 --- a/dist/debian/patches/series +++ b/dist/debian/patches/series @@ -1,2 +1,3 @@ fix-compilation-with-libav-8.patch +ffmpeg_2.9.patch From 23415170cc4779fe1e560f8bcdc2e7c3f497ee0f Mon Sep 17 00:00:00 2001 From: Arun Narayanankutty Date: Mon, 18 Jan 2016 04:25:48 -0600 Subject: [PATCH 8/8] no need of range in if statements level when falls through the new if else statements should assign the r, g, b values correctly --- src/spek-palette.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/spek-palette.cc b/src/spek-palette.cc index bf39088..2fe0d0e 100644 --- a/src/spek-palette.cc +++ b/src/spek-palette.cc @@ -24,23 +24,23 @@ uint32_t spek_palette_spectrum(double level) { level *= 0.6625; double r = 0.0, g = 0.0, b = 0.0; - if (level >= 0 && level < 0.15) { + if (level < 0.15) { r = (0.15 - level) / (0.15 + 0.075); g = 0.0; b = 1.0; - } else if (level >= 0.15 && level < 0.275) { + } else if (level < 0.275) { r = 0.0; g = (level - 0.15) / (0.275 - 0.15); b = 1.0; - } else if (level >= 0.275 && level < 0.325) { + } else if (level < 0.325) { r = 0.0; g = 1.0; b = (0.325 - level) / (0.325 - 0.275); - } else if (level >= 0.325 && level < 0.5) { + } else if (level < 0.5) { r = (level - 0.325) / (0.5 - 0.325); g = 1.0; b = 0.0; - } else if (level >= 0.5 && level < 0.6625) { + } else if (level < 0.6625) { r = 1.0; g = (0.6625 - level) / (0.6625 - 0.5f); b = 0.0;