[packages/sox] - added types patch (fixes types mismatch on ILP32 archs) - added ffmpeg patch (fixes build with ffm
qboosh
qboosh at pld-linux.org
Wed Aug 28 21:23:02 CEST 2013
commit 638c225163764a86f5734125f47fdfc566715721
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Aug 28 21:22:33 2013 +0200
- added types patch (fixes types mismatch on ILP32 archs)
- added ffmpeg patch (fixes build with ffmpeg2)
sox-ffmpeg.patch | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sox-types.patch | 11 +++++++++
sox.spec | 4 ++++
3 files changed, 84 insertions(+)
---
diff --git a/sox.spec b/sox.spec
index 0202fd3..b253486 100644
--- a/sox.spec
+++ b/sox.spec
@@ -25,6 +25,8 @@ Patch0: %{name}-system-lpc10.patch
Patch1: %{name}-dyn.patch
Patch2: sox-14.4.0-avcodec54.patch
Patch3: sox-14.4.0-ffmpeg.patch
+Patch4: %{name}-types.patch
+Patch5: %{name}-ffmpeg.patch
URL: http://sox.sourceforge.net/
%{?with_alsa:BuildRequires: alsa-lib-devel}
BuildRequires: autoconf >= 2.50
@@ -180,6 +182,8 @@ bibliotekę libmad, a do kodowania - LAME.
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
+%patch5 -p1
%build
%{__libtoolize}
diff --git a/sox-ffmpeg.patch b/sox-ffmpeg.patch
new file mode 100644
index 0000000..5e4c958
--- /dev/null
+++ b/sox-ffmpeg.patch
@@ -0,0 +1,69 @@
+--- sox-14.4.1/src/ffmpeg.c.orig 2013-08-28 21:02:16.835128774 +0200
++++ sox-14.4.1/src/ffmpeg.c 2013-08-28 21:17:33.048423663 +0200
+@@ -98,7 +98,7 @@
+ 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);
+@@ -163,7 +163,7 @@
+ int ret;
+ int i;
+
+- ffmpeg->audio_buf_raw = lsx_calloc(1, (size_t)AVCODEC_MAX_AUDIO_FRAME_SIZE + 32);
++ ffmpeg->audio_buf_raw = lsx_calloc(1, (size_t)192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */ + 32);
+ ffmpeg->audio_buf_aligned = ALIGN16(ffmpeg->audio_buf_raw);
+
+ /* Signal audio stream not found */
+@@ -235,7 +235,7 @@
+ if ((ret = av_read_frame(ffmpeg->ctxt, pkt)) < 0 &&
+ (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_size = audio_decode_frame(ffmpeg, ffmpeg->audio_buf_aligned, 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */ );
+ ffmpeg->audio_buf_index = 0;
+ }
+
+@@ -269,7 +269,7 @@
+ /*
+ * 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;
+@@ -308,18 +308,18 @@
+ }
+
+ /* 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;
+ }
+
+- ffmpeg->audio_buf_raw = lsx_malloc((size_t)AVCODEC_MAX_AUDIO_FRAME_SIZE + 32);
++ ffmpeg->audio_buf_raw = lsx_malloc((size_t)192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */ + 32);
+ ffmpeg->audio_buf_aligned = ALIGN16(ffmpeg->audio_buf_raw);
+
+ /* ugly hack for PCM codecs (will be removed ASAP with new PCM
+ support to compute the input frame size in samples */
+ if (c->frame_size <= 1) {
+- ffmpeg->audio_input_frame_size = AVCODEC_MAX_AUDIO_FRAME_SIZE / c->channels;
++ ffmpeg->audio_input_frame_size = 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */ / c->channels;
+ switch(st->codec->codec_id) {
+ case CODEC_ID_PCM_S16LE:
+ case CODEC_ID_PCM_S16BE:
+@@ -423,7 +423,7 @@
+ AVPacket pkt;
+
+ av_init_packet(&pkt);
+- pkt.size = avcodec_encode_audio(c, ffmpeg->audio_buf_aligned, AVCODEC_MAX_AUDIO_FRAME_SIZE, ffmpeg->samples);
++ pkt.size = avcodec_encode_audio(c, ffmpeg->audio_buf_aligned, 192000 /* AVCODEC_MAX_AUDIO_FRAME_SIZE */, ffmpeg->samples);
+ pkt.pts = av_rescale_q(c->coded_frame->pts, c->time_base, ffmpeg->audio_st->time_base);
+ pkt.flags |= AV_PKT_FLAG_KEY;
+ pkt.stream_index = ffmpeg->audio_st->index;
diff --git a/sox-types.patch b/sox-types.patch
new file mode 100644
index 0000000..2cee819
--- /dev/null
+++ b/sox-types.patch
@@ -0,0 +1,11 @@
+--- 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--)
+ {
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/sox.git/commitdiff/638c225163764a86f5734125f47fdfc566715721
More information about the pld-cvs-commit
mailing list