Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Nov 2007 23:38:11 +0700 (KRAT)
From:      Eugene Grosbein <eugen@grosbein.pp.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/117962: [patch] multimedia/mplayer: add an option for AMR audio codecs
Message-ID:  <200711101638.lAAGcBPt039645@grosbein.pp.ru>
Resent-Message-ID: <200711101650.lAAGo2sW015141@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
>Number:         117962
>Category:       ports
>Synopsis:       [patch] multimedia/mplayer: add an option for AMR audio codecs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 10 16:50:02 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Eugene Grosbein
>Release:        FreeBSD 7.0-BETA2 i386
>Organization:
Svyaz-Service JSC
>Environment:
System: FreeBSD grosbein.pp.ru 7.0-BETA2 FreeBSD 7.0-BETA2 #0: Sat Nov 10 00:29:26 KRAT 2007 eu@grosbein.pp.ru:/usr/local/obj/usr/local/obj/src/sys/DADV i386

>Description:
	Currently, mplayer port does not supply an option to build with
	AMR audio codecs enabled. These codecs often needed to view
	or recode 3gp video files containing audio in the AMR format.
 
>How-To-Repeat:
	Take a 3gp video file with AMR audio and try to play it with mplayer.
	It says that amr were not enabled in libavcodec at compile time
	and plays video but no audio

>Fix:
	The following patch adds a knob to config menu
	and when it's enabled, fetches sources for amr_nb and amr_wb codecs
	from 3gpp site, extracts them and gives a hint for mplayer's
	configure script. That's enough to build it with AMR support.

	The patch is effectively "no-op" if new knob is not checked.

diff -urN mplayer.orig/Makefile mplayer/Makefile
--- mplayer.orig/Makefile	2007-11-10 17:05:25.000000000 +0700
+++ mplayer/Makefile	2007-11-10 23:19:51.000000000 +0700
@@ -7,7 +7,7 @@
 
 PORTNAME=	mplayer
 PORTVERSION=	${MPLAYER_PORT_VERSION}
-PORTREVISION=	14
+PORTREVISION=	15
 COMMENT=	High performance media player supporting many formats
 
 .include "${.CURDIR}/Makefile.shared"
@@ -58,6 +58,7 @@
 OPTIONS+=	LIBCDIO "Enable libcdio support" off
 OPTIONS+=	CDPARANOIA "Enable cdparanoia support" off
 OPTIONS+=	LIBLZO "Enable external liblzo library" off
+OPTIONS+=	AMR "Enable AMR audio codecs support" off
 OPTIONS+=	JOYSTICK "Enable joystick support" off
 
 MAN1=		mplayer.1
diff -urN mplayer.orig/Makefile.options mplayer/Makefile.options
--- mplayer.orig/Makefile.options	2007-11-10 21:59:29.000000000 +0700
+++ mplayer/Makefile.options	2007-11-10 23:09:23.000000000 +0700
@@ -283,3 +283,27 @@
 .endif
 .endif
 
+.if defined(WITH_AMR)
+SRC_AMR_NB=	26104-700
+SRC_AMR_WB=     26204-700
+RESTRICTED=	license prohibits redistribution
+RESTRICTED_FILES+=	${SRC_AMR_NB}.zip ${SRC_AMR_WB}.zip
+
+BUILD_DEPENDS+=	${UNZIP_CMD}:${PORTSDIR}/archivers/unzip
+MASTER_SITES+=	http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/:3GPP_NB\
+		http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/:3GPP_WB
+EXTRACT_ONLY=	${DISTNAME}.tar.bz2
+DISTFILES+=	${SRC_AMR_NB}.zip:3GPP_NB ${SRC_AMR_WB}.zip:3GPP_WB
+
+post-extract:
+.for S in SRC_AMR_NB SRC_AMR_WB
+	@mkdir ${WRKDIR}/${S}
+	@cd ${WRKDIR}/${S} && ${UNZIP_CMD} -q ${DISTDIR}/${DIST_SUBDIR}/${${S}}.zip
+.endfor
+	@cd ${WRKDIR}/SRC_AMR_NB && \
+	    ${UNZIP_CMD} -q ${SRC_AMR_NB}_ANSI_C_source_code.zip && \
+	    ${LN} -s ../../SRC_AMR_NB/c-code ${WRKSRC}/libavcodec/amr_float
+	@cd ${WRKDIR}/SRC_AMR_WB && \
+	    ${UNZIP_CMD} -q ${SRC_AMR_WB}_ANSI-C_source_code.zip && \
+	    ${LN} -s ../../SRC_AMR_WB/c-code ${WRKSRC}/libavcodec/amrwb_float
+.endif
diff -urN mplayer.orig/distinfo mplayer/distinfo
--- mplayer.orig/distinfo	2007-04-17 21:56:17.000000000 +0800
+++ mplayer/distinfo	2007-11-10 23:19:40.000000000 +0700
@@ -1,3 +1,9 @@
+MD5 (26104-700.zip) = e8cedb8d502294ab7833ced0b407d238
+SHA256 (26104-700.zip) = d17e4e65b6f8138ff6243f194cefa6f2b39450075cdb2e9bb431e2dc5a43f541
+SIZE (26104-700.zip) = 303856
+MD5 (26204-700.zip) = 2e5098687d3007a05b7acc8298a5b072
+SHA256 (26204-700.zip) = 1b8ba234f5ac520650cb66aee1079491681afb7dba78eb717dca9534ae3598f0
+SIZE (26204-700.zip) = 255757
 MD5 (MPlayer-1.0rc1.tar.bz2) = 18c05d88e22c3b815a43ca8d7152ccdc
 SHA256 (MPlayer-1.0rc1.tar.bz2) = 8dd9dd61a0fe56904f5b76ddedb99bd359abaaf486e0b83b45e3357fecc81063
 SIZE (MPlayer-1.0rc1.tar.bz2) = 8414213


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711101638.lAAGcBPt039645>