+++ /dev/null
-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 <ffmpeg/avformat.h>
- #endif
-
-+#include <libavutil/mathematics.h>
-+
- #if defined __SUNPRO_C
- #pragma enable_warn
- #elif defined _MSC_VER
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
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
%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
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}
%{__automake}
%configure \
%{!?with_gomp:--disable-gomp} \
+ --disable-silent-rules \
--with-distro='PLD Linux Distribution' \
--with-dyn-default \
%{!?with_alsa:--without-alsa} \
%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
%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
%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