From: Jakub Bogusz Date: Sun, 29 Nov 2015 20:19:53 +0000 (+0100) Subject: - updated to 14.4.2 (note: new soname) X-Git-Tag: auto/th/sox-14.4.2-1 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fsox.git;a=commitdiff_plain;h=e2e1018 - updated to 14.4.2 (note: new soname) - removed obsolete ffmpeg,types patches - added link patch - ffmpeg fmt plugin is gone (in favour of using ffmpeg in pipe) - added opus fmt plugin --- diff --git a/sox-ffmpeg.patch b/sox-ffmpeg.patch deleted file mode 100644 index 77f742b..0000000 --- a/sox-ffmpeg.patch +++ /dev/null @@ -1,192 +0,0 @@ -diff -urN sox-14.4.1.org/m4/ffmpeg.m4 sox-14.4.1/m4/ffmpeg.m4 ---- sox-14.4.1.org/m4/ffmpeg.m4 2011-03-02 23:10:27.000000000 +0100 -+++ sox-14.4.1/m4/ffmpeg.m4 2014-10-13 07:11:31.825357581 +0200 -@@ -49,7 +49,7 @@ - LIBS="$LIBS $FFMPEG_LIBS" - have_ffmpeg="no" - AC_CHECK_HEADERS([libavformat/avformat.h ffmpeg/avformat.h], -- [AC_CHECK_LIB(avformat, av_open_input_file, -+ [AC_CHECK_LIB(avformat, avformat_open_input, - [AC_CHECK_HEADERS([libavcodec/avcodec.h ffmpeg/avcodec.h], - [AC_CHECK_LIB(avcodec, avcodec_decode_audio3, have_ffmpeg=yes)])]) - break]) -diff -urN sox-14.4.1.org/src/ffmpeg.c sox-14.4.1/src/ffmpeg.c ---- sox-14.4.1.org/src/ffmpeg.c 2012-01-23 23:27:33.000000000 +0100 -+++ sox-14.4.1/src/ffmpeg.c 2014-10-13 07:12:27.294541928 +0200 -@@ -57,6 +57,11 @@ - #define PKT_FLAG_KEY AV_PKT_FLAG_KEY - #endif - -+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE -+#define AVCODEC_MAX_AUDIO_FRAME_SIZE (192000 * 4) -+#endif -+ -+ - /* Private data for ffmpeg files */ - typedef struct { - int audio_index; -@@ -92,11 +97,13 @@ - enc->workaround_bugs = 1; - #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) - enc->error_resilience = 1; --#else -+#elif LIBAVCODEC_VERSION_INT < ((54<<16)+(0<<8)+0) - enc->error_recognition = 1; -+#else -+ ic->error_recognition = 1; - #endif - -- if (!codec || avcodec_open(enc, codec) < 0) -+ if (!codec || avcodec_open2(enc, codec, NULL) < 0) - return -1; - if (enc->codec_type != AVMEDIA_TYPE_AUDIO) { - lsx_fail("ffmpeg CODEC %x is not an audio CODEC", enc->codec_type); -@@ -157,7 +164,7 @@ - static int startread(sox_format_t * ft) - { - priv_t * ffmpeg = (priv_t *)ft->priv; -- AVFormatParameters params; -+ AVDictionary *params; - int ret; - int i; - -@@ -172,13 +179,13 @@ - - /* Open file and get format */ - memset(¶ms, 0, sizeof(params)); -- if ((ret = av_open_input_file(&ffmpeg->ctxt, ft->filename, NULL, 0, ¶ms)) < 0) { -+ if ((ret = avformat_open_input(&ffmpeg->ctxt, ft->filename, NULL, ¶ms)) < 0) { - lsx_fail("ffmpeg cannot open file for reading: %s (code %d)", ft->filename, ret); - return SOX_EOF; - } - - /* Get CODEC parameters */ -- if ((ret = av_find_stream_info(ffmpeg->ctxt)) < 0) { -+ if ((ret = avformat_find_stream_info(ffmpeg->ctxt, NULL)) < 0) { - lsx_fail("ffmpeg could not find CODEC parameters for %s", ft->filename); - return SOX_EOF; - } -@@ -231,7 +238,7 @@ - /* If input buffer empty, read more data */ - if (ffmpeg->audio_buf_index * 2 >= ffmpeg->audio_buf_size) { - if ((ret = av_read_frame(ffmpeg->ctxt, pkt)) < 0 && -- (ret == AVERROR_EOF || url_ferror(ffmpeg->ctxt->pb))) -+ (ret == AVERROR_EOF || ( ffmpeg->ctxt->pb && ffmpeg->ctxt->pb->error))) - break; - ffmpeg->audio_buf_size = audio_decode_frame(ffmpeg, ffmpeg->audio_buf_aligned, AVCODEC_MAX_AUDIO_FRAME_SIZE); - ffmpeg->audio_buf_index = 0; -@@ -256,8 +263,12 @@ - if (ffmpeg->audio_stream >= 0) - stream_component_close(ffmpeg, ffmpeg->audio_stream); - if (ffmpeg->ctxt) { -+#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(53,25,0) -+ avformat_close_input(&ffmpeg->ctxt); -+#else - av_close_input_file(ffmpeg->ctxt); - ffmpeg->ctxt = NULL; /* safety */ -+#endif - } - - free(ffmpeg->audio_buf_raw); -@@ -267,12 +278,12 @@ - /* - * add an audio output stream - */ --static AVStream *add_audio_stream(sox_format_t * ft, AVFormatContext *oc, enum CodecID codec_id) -+static AVStream *add_audio_stream(sox_format_t * ft, AVFormatContext *oc, enum AVCodecID codec_id) - { - AVCodecContext *c; - AVStream *st; - -- st = av_new_stream(oc, 1); -+ st = avformat_new_stream(oc, NULL); - if (!st) { - lsx_fail("ffmpeg could not alloc stream"); - return NULL; -@@ -306,7 +317,7 @@ - } - - /* open it */ -- if (avcodec_open(c, codec) < 0) { -+ if (avcodec_open2(c, codec, NULL) < 0) { - lsx_fail("ffmpeg could not open CODEC"); - return SOX_EOF; - } -@@ -319,10 +330,10 @@ - if (c->frame_size <= 1) { - ffmpeg->audio_input_frame_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / c->channels; - switch(st->codec->codec_id) { -- case CODEC_ID_PCM_S16LE: -- case CODEC_ID_PCM_S16BE: -- case CODEC_ID_PCM_U16LE: -- case CODEC_ID_PCM_U16BE: -+ case AV_CODEC_ID_PCM_S16LE: -+ case AV_CODEC_ID_PCM_S16BE: -+ case AV_CODEC_ID_PCM_U16LE: -+ case AV_CODEC_ID_PCM_U16BE: - ffmpeg->audio_input_frame_size >>= 1; - break; - default: -@@ -367,19 +378,12 @@ - /* add the audio stream using the default format codecs - and initialize the codecs */ - ffmpeg->audio_st = NULL; -- if (ffmpeg->fmt->audio_codec != CODEC_ID_NONE) { -+ if (ffmpeg->fmt->audio_codec != AV_CODEC_ID_NONE) { - ffmpeg->audio_st = add_audio_stream(ft, ffmpeg->ctxt, ffmpeg->fmt->audio_codec); - if (ffmpeg->audio_st == NULL) - return SOX_EOF; - } - -- /* set the output parameters (must be done even if no -- parameters). */ -- if (av_set_parameters(ffmpeg->ctxt, NULL) < 0) { -- lsx_fail("ffmpeg invalid output format parameters"); -- return SOX_EOF; -- } -- - /* Next line for debugging */ - /* dump_format(ffmpeg->ctxt, 0, ft->filename, 1); */ - -@@ -391,14 +395,14 @@ - - /* open the output file, if needed */ - if (!(ffmpeg->fmt->flags & AVFMT_NOFILE)) { -- if (url_fopen(&ffmpeg->ctxt->pb, ft->filename, URL_WRONLY) < 0) { -+ if (avio_open(&ffmpeg->ctxt->pb, ft->filename, AVIO_FLAG_WRITE) < 0) { - lsx_fail("ffmpeg could not open `%s'", ft->filename); - return SOX_EOF; - } - } - - /* write the stream header, if any */ -- av_write_header(ffmpeg->ctxt); -+ avformat_write_header(ffmpeg->ctxt, NULL); - - return SOX_SUCCESS; - } -@@ -475,11 +479,7 @@ - - if (!(ffmpeg->fmt->flags & AVFMT_NOFILE)) { - /* close the output file */ --#if (LIBAVFORMAT_VERSION_INT < 0x340000) -- url_fclose(&ffmpeg->ctxt->pb); --#else -- url_fclose(ffmpeg->ctxt->pb); --#endif -+ avio_close(ffmpeg->ctxt->pb); - } - - /* Free the output context */ -diff -urN sox-14.4.1.org/src/ffmpeg.h sox-14.4.1/src/ffmpeg.h ---- sox-14.4.1.org/src/ffmpeg.h 2012-01-23 23:27:33.000000000 +0100 -+++ sox-14.4.1/src/ffmpeg.h 2014-10-13 07:11:27.848510903 +0200 -@@ -27,6 +27,8 @@ - #include - #endif - -+#include -+ - #if defined __SUNPRO_C - #pragma enable_warn - #elif defined _MSC_VER diff --git a/sox-link.patch b/sox-link.patch new file mode 100644 index 0000000..a0e1c81 --- /dev/null +++ b/sox-link.patch @@ -0,0 +1,11 @@ +--- sox-14.4.2/src/Makefile.am.orig 2014-10-30 04:29:54.000000000 +0100 ++++ sox-14.4.2/src/Makefile.am 2015-11-29 16:54:55.088105285 +0100 +@@ -95,7 +95,7 @@ + + libsox_la_CFLAGS = @WARN_CFLAGS@ + libsox_la_LDFLAGS = @APP_LDFLAGS@ -version-info @SHLIB_VERSION@ \ +- -export-symbols-regex '^(sox_.*|lsx_(check_read_params|(close|open)_dllibrary|(debug(_more|_most)?|fail|report|warn)_impl|eof|fail_errno|filelength|find_(enum_(text|value)|file_extension)|getopt(_init)?|lpc10_(create_(de|en)coder_state|(de|en)code)|raw(read|write)|read(_b_buf|buf|chars)|realloc|rewind|seeki|sigfigs3p?|strcasecmp|tell|unreadb|write(b|_b_buf|buf|s)))$$' ++ -export-symbols-regex '^(sox_.*|lsx_(check_read_params|(close|open)_dllibrary|(debug(_more|_most)?|fail|report|warn)_impl|eof|error|fail_errno|filelength|find_(enum_(text|value)|file_extension)|flush|getopt(_init)?|lpc10_(create_(de|en)coder_state|(de|en)code)|raw(read|write)|read(_b_buf|buf|chars)|realloc|rewind|seeki|sigfigs3p?|strcasecmp|tell|unreadb|write(b|_b_buf|buf|s)))$$' + + if HAVE_WIN32_LTDL + libsox_la_SOURCES += win32-ltdl.c win32-ltdl.h diff --git a/sox-types.patch b/sox-types.patch deleted file mode 100644 index 2cee819..0000000 --- a/sox-types.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- sox-14.4.1/src/ao.c.orig 2013-01-13 20:57:39.000000000 +0100 -+++ sox-14.4.1/src/ao.c 2013-08-28 21:13:50.391766270 +0200 -@@ -74,7 +74,7 @@ - return SOX_SUCCESS; - } - --static void sox_sw_write_buf(char *buf1, sox_sample_t const * buf2, size_t len, sox_bool swap, size_t * clips) -+static void sox_sw_write_buf(char *buf1, sox_sample_t const * buf2, size_t len, sox_bool swap, sox_uint64_t * clips) - { - while (len--) - { diff --git a/sox.spec b/sox.spec index 2547236..9ebed81 100644 --- a/sox.spec +++ b/sox.spec @@ -15,21 +15,19 @@ Summary(ru.UTF-8): Утилита общего назначения для ра Summary(tr.UTF-8): Genel amaçlı ses dosyası çevirme aracı Summary(uk.UTF-8): Утиліта загального призначення для роботи із звуковими файлами Name: sox -Version: 14.4.1 -Release: 6 +Version: 14.4.2 +Release: 1 License: GPL v2+ (sox), LGPL v2+ (libsox) Group: Applications/Sound -Source0: http://downloads.sourceforge.net/sox/%{name}-%{version}.tar.gz -# Source0-md5: 670307f40763490a2bc0d1f322071e7a +Source0: http://downloads.sourceforge.net/sox/%{name}-%{version}.tar.bz2 +# Source0-md5: ba804bb1ce5c71dd484a102a5b27d0dd Patch0: %{name}-system-lpc10.patch Patch1: %{name}-dyn.patch -Patch2: %{name}-ffmpeg.patch -Patch3: %{name}-types.patch +Patch2: %{name}-link.patch URL: http://sox.sourceforge.net/ %{?with_alsa:BuildRequires: alsa-lib-devel} -BuildRequires: autoconf >= 2.50 +BuildRequires: autoconf >= 2.62 BuildRequires: automake -BuildRequires: ffmpeg-devel >= 0.7.1 BuildRequires: flac-devel >= 1.1.3 %{?with_gomp:BuildRequires: gcc >= 6:4.2} BuildRequires: ladspa-devel @@ -48,10 +46,13 @@ BuildRequires: libtool BuildRequires: libvorbis-devel >= 1:1.0 BuildRequires: lpc10-devel %{?with_amr:BuildRequires: opencore-amr-devel} +BuildRequires: opusfile-devel %{?with_pulseaudio:BuildRequires: pulseaudio-devel} BuildRequires: pkgconfig BuildRequires: twolame-devel BuildRequires: wavpack-devel +Suggests: ffmpeg +Obsoletes: sox-fmt-ffmpeg BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -132,20 +133,6 @@ SoX modules with AMR-NB and AMR-WB format support. %description fmt-amr -l pl.UTF-8 Moduły SoX obsługujące formaty AMR-NB i AMR-WB. -%package fmt-ffmpeg -Summary: SoX module which uses ffmpeg codecs -Summary(pl.UTF-8): Moduł SoX wykorzystujący kodeki ffmpeg -# ffmpeg in PLD is compiled as GPL -License: GPL v2+ -Group: Libraries -Requires: %{name} = %{version}-%{release} - -%description fmt-ffmpeg -SoX module which uses ffmpeg codecs. - -%description fmt-ffmpeg -l pl.UTF-8 -Moduł SoX wykorzystujący kodeki ffmpeg. - %package fmt-lpc10 Summary: SoX module with LPC10 format support Summary(pl.UTF-8): Moduł SoX obsługujący format LPC10 @@ -174,12 +161,25 @@ LAME for encoding. Moduł SoX obsługujący format MP3. Wykorzystuje do dekodowania bibliotekę libmad, a do kodowania - LAME. +%package fmt-opus +Summary: SoX module with Ogg Opus format support +Summary(pl.UTF-8): Moduł SoX obsługujący format Ogg Opus +Group: Libraries +Requires: %{name} = %{version}-%{release} + +%description fmt-opus +SoX module with Ogg Opus format support. It uses opusfile library +for decoding. + +%description fmt-opus -l pl.UTF-8 +Moduł SoX obsługujący format Ogg Opus. Wykorzystuje do dekodowania +bibliotekę opusfile. + %prep %setup -q %patch0 -p1 %patch1 -p1 %patch2 -p1 -%patch3 -p1 %build %{__libtoolize} @@ -189,6 +189,7 @@ bibliotekę libmad, a do kodowania - LAME. %{__automake} %configure \ %{!?with_gomp:--disable-gomp} \ + --disable-silent-rules \ --with-distro='PLD Linux Distribution' \ --with-dyn-default \ %{!?with_alsa:--without-alsa} \ @@ -229,7 +230,7 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/soxi %attr(755,root,root) %{_bindir}/soxplay %attr(755,root,root) %{_libdir}/libsox.so.*.*.* -%attr(755,root,root) %ghost %{_libdir}/libsox.so.2 +%attr(755,root,root) %ghost %{_libdir}/libsox.so.3 %dir %{_libdir}/sox %if %{with alsa} # R: alsa-lib @@ -289,11 +290,6 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_libdir}/sox/libsox_fmt_amr_wb.so %endif -%files fmt-ffmpeg -%defattr(644,root,root,755) -# R: ffmpeg-libs -%attr(755,root,root) %{_libdir}/sox/libsox_fmt_ffmpeg.so - %files fmt-lpc10 %defattr(644,root,root,755) # R: lpc10 @@ -303,3 +299,8 @@ rm -rf $RPM_BUILD_ROOT %defattr(644,root,root,755) # R: lame-libs libmad %attr(755,root,root) %{_libdir}/sox/libsox_fmt_mp3.so + +%files fmt-opus +%defattr(644,root,root,755) +# R: opusfile +%attr(755,root,root) %{_libdir}/sox/libsox_fmt_opus.so