debian/0000775000000000000000000000000012566427574007212 5ustar debian/acoustid-fingerprinter.manpages0000664000000000000000000000004012321662304015365 0ustar debian/acoustid-fingerprinter.1 debian/acoustid-fingerprinter.10000664000000000000000000000070612321662304013743 0ustar .TH ACOUSTID-FINGERPRINTER 1 "October 30, 2010" .SH NAME acoustid-fingerprinter \- audio fingerprint submission tool .SH SYNOPSIS .B acoustid-fingerprinter .PP .SH DESCRIPTION This manual page documents briefly the .B Acoustid Fingerprinter application. .PP .SH AUTHOR Acoustid Fingerprinter was written by Lukáš Lalinský. .PP This manual page was written by Lukáš Lalinský , for the Debian project (and may be used by others). debian/source/0000775000000000000000000000000012321662304010467 5ustar debian/source/format0000664000000000000000000000001412321662304011675 0ustar 3.0 (quilt) debian/menu0000664000000000000000000000022612321662304010056 0ustar ?package(acoustid-fingerprinter):needs="X11" section="Applications/Sound"\ title="Acoustid Fingerprinter" command="/usr/bin/acoustid-fingerprinter" debian/patches/0000775000000000000000000000000012377222637010632 5ustar debian/patches/03-pkg-config.patch0000664000000000000000000000304012377222637014114 0ustar Description: Use pkg-config to determine FFmpeg linker flags Author: Andreas Cadhalpun Last-Update: <2014-07-27> --- acoustid-fingerprinter-0.6.orig/CMakeLists.txt +++ acoustid-fingerprinter-0.6/CMakeLists.txt @@ -12,6 +12,7 @@ set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED) +find_package(PkgConfig REQUIRED) find_package(FFmpeg REQUIRED) find_package(Taglib REQUIRED) find_package(Chromaprint REQUIRED) --- acoustid-fingerprinter-0.6.orig/cmake/modules/FindFFmpeg.cmake +++ acoustid-fingerprinter-0.6/cmake/modules/FindFFmpeg.cmake @@ -47,29 +47,7 @@ MACRO(FFMPEG_FIND varname shortname head DOC "Location of FFMPEG Headers" ) - FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES - NAMES ${shortname} - PATHS - ${FFMPEG_ROOT}/lib - $ENV{FFMPEG_DIR}/lib - ~/Library/Frameworks - /Library/Frameworks - /usr/local/lib - /usr/local/lib64 - /usr/lib - /usr/lib64 - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 - NO_DEFAULT_PATH - DOC "Location of FFMPEG Libraries" - ) - FIND_LIBRARY(FFMPEG_${varname}_LIBRARIES - NAMES ${shortname} - DOC "Location of FFMPEG Libraries" - ) + pkg_check_modules(FFMPEG_${varname} lib${shortname}) IF (FFMPEG_${varname}_LIBRARIES AND FFMPEG_${varname}_INCLUDE_DIRS) SET(FFMPEG_${varname}_FOUND 1) debian/patches/02-CodecID.patch0000664000000000000000000000243012377222627013322 0ustar Description: Replace removed macros Rename CodecID to AVCodecID and replace AVCODEC_MAX_AUDIO_FRAME_SIZE with its last value 192000. Author: Andreas Cadhalpun Last-Update: <2014-05-13> --- acoustid-fingerprinter-0.6.orig/decoder.h +++ acoustid-fingerprinter-0.6/decoder.h @@ -116,7 +116,7 @@ inline Decoder::Decoder(const std::strin #endif { #ifdef HAVE_AV_AUDIO_CONVERT - m_buffer2 = (uint8_t *)av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE * 2 + 16); + m_buffer2 = (uint8_t *)av_malloc(192000 * 2 + 16); #endif #if NEW_AVFRAME_API --- acoustid-fingerprinter-0.6.orig/ffmpeg/audioconvert.h +++ acoustid-fingerprinter-0.6/ffmpeg/audioconvert.h @@ -75,11 +75,11 @@ int avcodec_channel_layout_num_channels( /** * Guess the channel layout * @param nb_channels - * @param codec_id Codec identifier, or CODEC_ID_NONE if unknown + * @param codec_id Codec identifier, or AV_CODEC_ID_NONE if unknown * @param fmt_name Format name, or NULL if unknown * @return Channel layout mask */ -uint64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name); +uint64_t avcodec_guess_channel_layout(int nb_channels, enum AVCodecID codec_id, const char *fmt_name); struct AVAudioConvert; typedef struct AVAudioConvert AVAudioConvert; debian/patches/01-Fix-build-with-upcoming-Libav-10-release.patch0000664000000000000000000001370112321662304021361 0ustar Description: Fix build with upcoming Libav 10 release Drops support for pre-0.8 releases to reduce clutter, but those are over three years old now and no current distros carry them. Forwarded: https://bitbucket.org/acoustid/acoustid-fingerprinter/pull-request/3/fix-build-with-upcoming-libav-10-release/diff Author: Anton Khirnov diff --git a/decoder.h b/decoder.h index 028f58f..310fe2d 100644 --- a/decoder.h +++ b/decoder.h @@ -28,6 +28,12 @@ extern "C" { #include #include + +#define NEW_AVFRAME_API (LIBAVCODEC_VERSION_MAJOR >= 55) +#if NEW_AVFRAME_API +#include +#endif + #ifdef HAVE_AV_AUDIO_CONVERT #include "ffmpeg/audioconvert.h" #include "ffmpeg/samplefmt.h" @@ -35,10 +41,6 @@ extern "C" { } #include "fingerprintcalculator.h" -#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 64, 0) -#define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16 -#endif - class Decoder { public: @@ -67,8 +69,6 @@ public: static void initialize(); private: - static const int BUFFER_SIZE = AVCODEC_MAX_AUDIO_FRAME_SIZE * 2; - uint8_t *m_buffer1; uint8_t *m_buffer2; std::string m_file_name; std::string m_error; @@ -77,6 +77,7 @@ private: bool m_codec_open; AVStream *m_stream; static QMutex m_mutex; + AVFrame *m_frame; #ifdef HAVE_AV_AUDIO_CONVERT AVAudioConvert *m_convert_ctx; #endif @@ -114,8 +115,15 @@ inline Decoder::Decoder(const std::string &file_name) , m_convert_ctx(0) #endif { - m_buffer1 = (uint8_t *)av_malloc(BUFFER_SIZE + 16); - m_buffer2 = (uint8_t *)av_malloc(BUFFER_SIZE + 16); +#ifdef HAVE_AV_AUDIO_CONVERT + m_buffer2 = (uint8_t *)av_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE * 2 + 16); +#endif + +#if NEW_AVFRAME_API + m_frame = av_frame_alloc(); +#else + m_frame = avcodec_alloc_frame(); +#endif } inline Decoder::~Decoder() @@ -125,39 +133,32 @@ inline Decoder::~Decoder() avcodec_close(m_codec_ctx); } if (m_format_ctx) { -#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 17, 0) - av_close_input_file(m_format_ctx); -#else avformat_close_input(&m_format_ctx); -#endif } #ifdef HAVE_AV_AUDIO_CONVERT if (m_convert_ctx) { av_audio_convert_free(m_convert_ctx); } -#endif - av_free(m_buffer1); av_free(m_buffer2); +#endif + +#if NEW_AVFRAME_API + av_frame_free(&m_frame); +#else + av_freep(&m_frame); +#endif } inline bool Decoder::Open() { QMutexLocker locker(&m_mutex); -#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 2, 0) - if (av_open_input_file(&m_format_ctx, m_file_name.c_str(), NULL, 0, NULL) != 0) { -#else if (avformat_open_input(&m_format_ctx, m_file_name.c_str(), NULL, NULL) != 0) { -#endif m_error = "Couldn't open the file." + m_file_name; return false; } -#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 6, 0) - if (av_find_stream_info(m_format_ctx) < 0) { -#else if (avformat_find_stream_info(m_format_ctx, NULL) < 0) { -#endif m_error = "Couldn't find stream information in the file."; return false; } @@ -166,11 +167,7 @@ inline bool Decoder::Open() for (int i = 0; i < m_format_ctx->nb_streams; i++) { AVCodecContext *avctx = m_format_ctx->streams[i]->codec; -#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 64, 0) - if (avctx && avctx->codec_type == CODEC_TYPE_AUDIO) { -#else if (avctx && avctx->codec_type == AVMEDIA_TYPE_AUDIO) { -#endif m_stream = m_format_ctx->streams[i]; m_codec_ctx = avctx; break; @@ -187,11 +184,7 @@ inline bool Decoder::Open() return false; } -#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 8, 0) - if (avcodec_open(m_codec_ctx, codec) < 0) { -#else if (avcodec_open2(m_codec_ctx, codec, NULL) < 0) { -#endif m_error = "Couldn't open the codec."; return false; } @@ -244,17 +237,9 @@ inline void Decoder::Decode(FingerprintCalculator *consumer, int max_length) packet_temp.data = packet.data; packet_temp.size = packet.size; while (packet_temp.size > 0) { - int buffer_size = BUFFER_SIZE; -#if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(52, 25, 0) - int consumed = avcodec_decode_audio2( - m_codec_ctx, (int16_t *)m_buffer1, &buffer_size, - packet_temp.data, packet_temp.size); -#else - int consumed = avcodec_decode_audio3( - m_codec_ctx, (int16_t *)m_buffer1, &buffer_size, - &packet_temp); -#endif - + int got_output; + int consumed = avcodec_decode_audio4(m_codec_ctx, m_frame, + &got_output, &packet_temp); if (consumed < 0) { break; } @@ -262,36 +247,31 @@ inline void Decoder::Decode(FingerprintCalculator *consumer, int max_length) packet_temp.data += consumed; packet_temp.size -= consumed; - if (buffer_size <= 0) { + if (!got_output) { continue; } int16_t *audio_buffer; #ifdef HAVE_AV_AUDIO_CONVERT if (m_convert_ctx) { - const void *ibuf[6] = { m_buffer1 }; + const void *ibuf[6] = { m_frame->data[0] }; void *obuf[6] = { m_buffer2 }; -#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(51, 8, 0) - int istride[6] = { av_get_bits_per_sample_format(m_codec_ctx->sample_fmt) / 8 }; -#else int istride[6] = { av_get_bytes_per_sample(m_codec_ctx->sample_fmt) }; -#endif int ostride[6] = { 2 }; - int len = buffer_size / istride[0]; + int len = m_frame->nb_samples; if (av_audio_convert(m_convert_ctx, obuf, ostride, ibuf, istride, len) < 0) { break; } audio_buffer = (int16_t *)m_buffer2; - buffer_size = len * ostride[0]; } else { - audio_buffer = (int16_t *)m_buffer1; + audio_buffer = (int16_t *)m_frame->data[0]; } #else - audio_buffer = (int16_t *)m_buffer1; + audio_buffer = (int16_t *)m_frame->data[0]; #endif - int length = buffer_size / 2; + int length = m_frame->nb_samples; if (max_length) { length = std::min(remaining, length); } debian/patches/series0000664000000000000000000000012712377222637012047 0ustar 01-Fix-build-with-upcoming-Libav-10-release.patch 02-CodecID.patch 03-pkg-config.patch debian/compat0000664000000000000000000000000212321662304010365 0ustar 7 debian/control0000664000000000000000000000106212377222637010605 0ustar Source: acoustid-fingerprinter Section: sound Priority: optional Maintainer: Jerome Charaoui Build-Depends: debhelper (>= 8.0.0), cmake, cdbs, libavformat-dev, libavcodec-dev, libchromaprint-dev, libqt4-dev, libtag1-dev, pkg-config Standards-Version: 3.9.5 Homepage: http://wiki.acoustid.org/wiki/Fingerprinter Package: acoustid-fingerprinter Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Acoustid fingerprinter GUI application for submission Chromaprint-generated audio fingerprints to the Acoustid service. debian/watch0000664000000000000000000000013712321662304010221 0ustar version=3 https://bitbucket.org/acoustid/acoustid-fingerprinter/downloads .*\-(\d\S*)\.tar\.gz debian/changelog0000664000000000000000000000334712566427574011073 0ustar acoustid-fingerprinter (0.6-4build1) wily; urgency=medium * No change rebuild for libtag1v5 -- Micah Gersten Sun, 23 Aug 2015 15:39:24 -0500 acoustid-fingerprinter (0.6-4) unstable; urgency=low * Make package FFmpeg-friendly (Closes: #758323) Patch provided by Andreas Cadhalpun. -- Jerome Charaoui Tue, 26 Aug 2014 20:30:49 -0400 acoustid-fingerprinter (0.6-3) unstable; urgency=low * Fix build with upcoming Libav 10 release (Closes: #739208) Patch provided by Anton Khirnov. -- Jerome Charaoui Thu, 10 Apr 2014 23:31:01 -0400 acoustid-fingerprinter (0.6-2) unstable; urgency=low * New maintainer. (Closes: #737287) * Switch to CDBS. * Convert debian/copyright into standard machine-readable format. * Remove misleading "options" in man page. (Closes: #682139) * Bump to Standards-Version 3.9.5. -- Jerome Charaoui Sat, 08 Feb 2014 22:48:15 -0500 acoustid-fingerprinter (0.6-1) unstable; urgency=low * New upstream version. closes: #682140. * Bump to Standards-Version 3.9.4. * Orphan package. -- Clint Adams Sun, 05 May 2013 08:45:16 -0400 acoustid-fingerprinter (0.4-2) unstable; urgency=high * Explicitly set the content type, as Qt changed the default. closes: #685283. * Bump to Standards-Version 3.9.3. -- Clint Adams Sat, 25 Aug 2012 12:59:41 -0400 acoustid-fingerprinter (0.4-1) unstable; urgency=low * New upstream release. -- Clint Adams Thu, 25 Aug 2011 21:10:42 -0400 acoustid-fingerprinter (0.1-1) unstable; urgency=low * Initial release based on upstream packaging. -- Clint Adams Thu, 12 May 2011 19:54:52 -0400 debian/docs0000664000000000000000000000001312321662304010034 0ustar README.txt debian/copyright0000664000000000000000000000425512321662304011130 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: AcoustID fingerprinter Upstream-Contact: Lukáš Lalinský Source: http://acoustid.org/fingerprinter Files: * Copyright: Copyright (C) 2010 Lukáš Lalinský License: GPL-2+ Files: tagreader.h decoder.h Copyright: Copyright (C) 2010 Lukas Lalinsky License: LGPL-2.1+ Files: debian/* Copyright: Copyright (C) 2010 Lukáš Lalinský License: GPL-2+ License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. . On Debian systems, the complete text of the GNU General Public License version 2 can be found in ‘/usr/share/common-licenses/GPL-2’. License: LGPL-2.1+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. . You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. . On Debian systems, the complete text of the GNU Lesser General Public License version 2.1 can be found in ‘/usr/share/common-licenses/LGPL-2.1’. debian/rules0000775000000000000000000000024012321662304010243 0ustar #!/usr/bin/make -f DEB_CMAKE_EXTRA_FLAGS := -DCMAKE_BUILD_TYPE=Release include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/cmake.mk