View | Details | Raw Unified | Return to bug 157673 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-11 / +7 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	sox
8
PORTNAME=	sox
9
PORTVERSION=	14.3.1
9
PORTVERSION=	14.3.2
10
CATEGORIES=	audio
10
CATEGORIES=	audio
11
MASTER_SITES=	SF
11
MASTER_SITES=	SF
12
12
Lines 23-28 Link Here
23
USE_LDCONFIG=	yes
23
USE_LDCONFIG=	yes
24
USE_AUTOTOOLS=	libltdl
24
USE_AUTOTOOLS=	libltdl
25
USE_GNOME=	pkgconfig
25
USE_GNOME=	pkgconfig
26
LICENSE_COMB=	dual
27
LICENSE=	LGPL21 GPLv2
26
28
27
# Default LAME to off for packages so we don't end up RESTRICTED
29
# Default LAME to off for packages so we don't end up RESTRICTED
28
.if defined(PACKAGE_BUILDING)
30
.if defined(PACKAGE_BUILDING)
Lines 51-57 Link Here
51
53
52
CPPFLAGS+=	-I${LOCALBASE}/include
54
CPPFLAGS+=	-I${LOCALBASE}/include
53
LDFLAGS+=	-L${LOCALBASE}/lib ${PTHREAD_LIBS}
55
LDFLAGS+=	-L${LOCALBASE}/lib ${PTHREAD_LIBS}
54
CONFIGURE_ENV+=	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
56
CONFIGURE_ENV+=	LDFLAGS="${LDFLAGS}"
55
CONFIGURE_ARGS+=	--with-pkgconfigdir="${PREFIX}/libdata/pkgconfig"
57
CONFIGURE_ARGS+=	--with-pkgconfigdir="${PREFIX}/libdata/pkgconfig"
56
CONFIGURE_ARGS+=	--with-distro="${CONFIGURE_TARGET} ${PKGNAME}"
58
CONFIGURE_ARGS+=	--with-distro="${CONFIGURE_TARGET} ${PKGNAME}"
57
59
Lines 147-154 Link Here
147
.else
149
.else
148
CONFIGURE_ARGS+=	--with-gsm
150
CONFIGURE_ARGS+=	--with-gsm
149
# We cannot ask for gsm to be enabled without it trying to use external gsm,
151
# We cannot ask for gsm to be enabled without it trying to use external gsm,
150
# so workaround with the below line
152
# so force the autoconf checks to fail
151
CONFIGURE_ENV+=		ac_cv_header_gsm_h=no
153
CONFIGURE_ENV+=	ac_cv_header_gsm_h=no ac_cv_header_gsm_gsm_h=no \
154
		ac_cv_lib_gsm_gsm_create=no
152
.endif
155
.endif
153
156
154
.if defined(WITH_ID3TAG)
157
.if defined(WITH_ID3TAG)
Lines 165-175 Link Here
165
CONFIGURE_ARGS+=	--without-wavpack
168
CONFIGURE_ARGS+=	--without-wavpack
166
.endif
169
.endif
167
170
168
# Tell configure that libgsm's headers are in $LOCALDIR/include
169
post-patch:
170
	@${REINPLACE_CMD} -Ee 's![[:<:]]gsm/gsm.h!gsm.h!' ${WRKSRC}/configure \
171
		${WRKSRC}/src/gsm.c ${WRKSRC}/src/wav.c
172
	@${REINPLACE_CMD} -Ee 's!ffmpeg/avformat.h!libavformat/avformat.h!' \
173
		${WRKSRC}/configure ${WRKSRC}/src/ffmpeg.c
174
175
.include <bsd.port.post.mk>
171
.include <bsd.port.post.mk>
(-)distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (sox-14.3.1.tar.gz) = c4be9ebdb1e77a3bc9f3ee1f3fd274a1fe7b162a174fcc74874b231f3f1ace54
1
SHA256 (sox-14.3.2.tar.gz) = 0668cc087c346f7c4084ae294c676a11ddefb462974bc3f67be30d789c850e8f
2
SIZE (sox-14.3.1.tar.gz) = 1044595
2
SIZE (sox-14.3.2.tar.gz) = 1110175
(-)files/patch-ffmpeg (+55 lines)
Added Link Here
1
*** diff
2
3
Update to use the new ffmpeg library API, but still work with 
4
the old one.
5
6
--- src/ffmpeg.c	2011-06-07 00:29:34.000000000 -0500
7
+++ src/ffmpeg.c	2011-06-07 00:34:12.830996927 -0500
8
@@ -50,6 +50,11 @@
9
 #include <ctype.h>
10
 #include "ffmpeg.h"
11
 
12
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 64, 0)
13
+#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
14
+#define AV_PKT_FLAG_KEY PKT_FLAG_KEY
15
+#endif
16
+ 		    
17
 /* Private data for ffmpeg files */
18
 typedef struct {
19
   int audio_index;
20
@@ -91,7 +96,7 @@ static int stream_component_open(priv_t 
21
 
22
   if (!codec || avcodec_open(enc, codec) < 0)
23
     return -1;
24
-  if (enc->codec_type != CODEC_TYPE_AUDIO) {
25
+  if (enc->codec_type != AVMEDIA_TYPE_AUDIO) {
26
     lsx_fail("ffmpeg CODEC %x is not an audio CODEC", enc->codec_type);
27
     return -1;
28
   }
29
@@ -182,7 +187,7 @@ static int startread(sox_format_t * ft)
30
   /* Find audio stream (FIXME: allow different stream to be selected) */
31
   for (i = 0; (unsigned)i < ffmpeg->ctxt->nb_streams; i++) {
32
     AVCodecContext *enc = ffmpeg->ctxt->streams[i]->codec;
33
-    if (enc->codec_type == CODEC_TYPE_AUDIO && ffmpeg->audio_index < 0) {
34
+    if (enc->codec_type == AVMEDIA_TYPE_AUDIO && ffmpeg->audio_index < 0) {
35
       ffmpeg->audio_index = i;
36
       break;
37
     }
38
@@ -273,7 +278,7 @@ static AVStream *add_audio_stream(sox_fo
39
 
40
   c = st->codec;
41
   c->codec_id = codec_id;
42
-  c->codec_type = CODEC_TYPE_AUDIO;
43
+  c->codec_type = AVMEDIA_TYPE_AUDIO;
44
 
45
   /* put sample parameters */
46
   c->bit_rate = 256000;  /* FIXME: allow specification */
47
@@ -423,7 +428,7 @@ static size_t write_samples(sox_format_t
48
       av_init_packet(&pkt);
49
       pkt.size = avcodec_encode_audio(c, ffmpeg->audio_buf_aligned, AVCODEC_MAX_AUDIO_FRAME_SIZE, ffmpeg->samples);
50
       pkt.pts = av_rescale_q(c->coded_frame->pts, c->time_base, ffmpeg->audio_st->time_base);
51
-      pkt.flags |= PKT_FLAG_KEY;
52
+      pkt.flags |= AV_PKT_FLAG_KEY;
53
       pkt.stream_index = ffmpeg->audio_st->index;
54
       pkt.data = ffmpeg->audio_buf_aligned;
55
 

Return to bug 157673