packages: sox/sox.spec, sox/sox-ffmpeg.patch - fixed build with new ffmpeg

lisu lisu at pld-linux.org
Tue Jul 5 15:25:06 CEST 2011


Author: lisu                         Date: Tue Jul  5 13:25:06 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- fixed build with new ffmpeg

---- Files affected:
packages/sox:
   sox.spec (1.71 -> 1.72) , sox-ffmpeg.patch (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: packages/sox/sox.spec
diff -u packages/sox/sox.spec:1.71 packages/sox/sox.spec:1.72
--- packages/sox/sox.spec:1.71	Mon Jun 27 21:21:54 2011
+++ packages/sox/sox.spec	Tue Jul  5 15:25:00 2011
@@ -24,11 +24,12 @@
 # Source0-md5:	e9d35cf3b0f8878596e0b7c49f9e8302
 Patch0:		%{name}-system-lpc10.patch
 Patch1:		%{name}-dyn.patch
+Patch2:		%{name}-ffmpeg.patch
 URL:		http://sox.sourceforge.net/
 %{?with_alsa:BuildRequires:	alsa-lib-devel}
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
-BuildRequires:	ffmpeg-devel >= 0.4.9-4.20080930.1
+BuildRequires:	ffmpeg-devel >= 0.7.1
 BuildRequires:	flac-devel
 %{?with_gomp:BuildRequires:	gcc >= 6:4.2}
 BuildRequires:	ladspa-devel
@@ -176,6 +177,7 @@
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %{__libtoolize}
@@ -307,6 +309,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.72  2011/07/05 13:25:00  lisu
+- fixed build with new ffmpeg
+
 Revision 1.71  2011/06/27 19:21:54  arekm
 - release 2
 

================================================================
Index: packages/sox/sox-ffmpeg.patch
diff -u /dev/null packages/sox/sox-ffmpeg.patch:1.3
--- /dev/null	Tue Jul  5 15:25:06 2011
+++ packages/sox/sox-ffmpeg.patch	Tue Jul  5 15:25:00 2011
@@ -0,0 +1,39 @@
+Index: sox-14.3.2/src/ffmpeg.c
+===================================================================
+--- sox-14.3.2.orig/src/ffmpeg.c
++++ sox-14.3.2/src/ffmpeg.c
+@@ -91,7 +91,7 @@ static int stream_component_open(priv_t
+ 
+   if (!codec || avcodec_open(enc, codec) < 0)
+     return -1;
+-  if (enc->codec_type != CODEC_TYPE_AUDIO) {
++  if (enc->codec_type != AVMEDIA_TYPE_AUDIO) {
+     lsx_fail("ffmpeg CODEC %x is not an audio CODEC", enc->codec_type);
+     return -1;
+   }
+@@ -182,7 +182,7 @@ static int startread(sox_format_t * ft)
+   /* Find audio stream (FIXME: allow different stream to be selected) */
+   for (i = 0; (unsigned)i < ffmpeg->ctxt->nb_streams; i++) {
+     AVCodecContext *enc = ffmpeg->ctxt->streams[i]->codec;
+-    if (enc->codec_type == CODEC_TYPE_AUDIO && ffmpeg->audio_index < 0) {
++    if (enc->codec_type == AVMEDIA_TYPE_AUDIO && ffmpeg->audio_index < 0) {
+       ffmpeg->audio_index = i;
+       break;
+     }
+@@ -273,7 +273,7 @@ static AVStream *add_audio_stream(sox_fo
+ 
+   c = st->codec;
+   c->codec_id = codec_id;
+-  c->codec_type = CODEC_TYPE_AUDIO;
++  c->codec_type = AVMEDIA_TYPE_AUDIO;
+ 
+   /* put sample parameters */
+   c->bit_rate = 256000;  /* FIXME: allow specification */
+@@ -423,7 +423,7 @@ static size_t write_samples(sox_format_t
+       av_init_packet(&pkt);
+       pkt.size = avcodec_encode_audio(c, ffmpeg->audio_buf_aligned, 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 |= PKT_FLAG_KEY;
++      pkt.flags |= AV_PKT_FLAG_KEY;
+       pkt.stream_index = ffmpeg->audio_st->index;
+       pkt.data = ffmpeg->audio_buf_aligned;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/sox/sox.spec?r1=1.71&r2=1.72&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/sox/sox-ffmpeg.patch?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list