From nobody@FreeBSD.org  Sat Nov 24 19:46:33 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 00B0616A41A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 24 Nov 2007 19:46:33 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id E57CD13C455
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 24 Nov 2007 19:46:32 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id lAOJkWOk038561
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 24 Nov 2007 19:46:32 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id lAOJkWHk038560;
	Sat, 24 Nov 2007 19:46:32 GMT
	(envelope-from nobody)
Message-Id: <200711241946.lAOJkWHk038560@www.freebsd.org>
Date: Sat, 24 Nov 2007 19:46:32 GMT
From: Tatsuki Makino <tatsuki_makino@hotmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Ports: multimedia/ffmpeg fix configure option and add supports
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         118237
>Category:       ports
>Synopsis:       Ports: multimedia/ffmpeg fix configure option and add supports
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 24 19:50:02 UTC 2007
>Closed-Date:    Wed Aug 12 09:40:59 UTC 2009
>Last-Modified:  Wed Aug 12 09:40:59 UTC 2009
>Originator:     Tatsuki Makino
>Release:        FreeBSD 6.3-PRERELEASE i386
>Organization:
>Environment:
FreeBSD FreeBSD-C2D.DHCP.test 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #0: Sat Nov 24 00:52:17 JST 2007     root@FreeBSD-C2D.DHCP.test:/usr/obj/usr/src/sys/SMP  i386
>Description:
1. Add --cpu configure argument.

2. Add miscellaneous for bktr glab.

3. Add libamr_nb and libamr_wb support.

4. Add USE_GCC=4.2
>How-To-Repeat:
1. No problems. but disabled cmov and fast_cmov support on my machine

2. No problems. but I want to fix the video format to NTSC-J without environment variable.

3. No problems. but I want to do laziness. :-)

4.
ffmpeg -i ~/input.mpg -f mpeg -y ~/output.mpg

FFmpeg version SVN-r10657, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --cc (snip, without --disable-mmx) 
(snip)
Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. You may try recompiling using gcc >= 4.2.
Do not report crashes to FFmpeg developers.

>Fix:


Patch attached with submission follows:

--- Makefile.orig	2007-10-09 19:38:24.000000000 +0000
+++ Makefile	2007-11-24 19:09:00.000000000 +0000
@@ -63,6 +63,12 @@
 MAN1+=	ffmpeg.1 ffserver.1
 .endif
 
+.if ${OSVERSION} < 700042
+. ifdef WITH_GCC42
+USE_GCC=	4.2
+. endif
+.endif
+
 .ifdef(WITH_OPTIMIZED_CFLAGS)
 CFLAGS:=		${CFLAGS:N-O*} -O3 -ffast-math -fomit-frame-pointer
 .else
@@ -70,6 +76,17 @@
 DEBUG_FLAGS+=		 -O2
 .endif
 
+.ifdef WITH_CPU
+. if ${WITH_CPU:L} == "yes" || ${WITH_CPU:L} == "true"
+CONFIGURE_ARGS+=	--cpu=${CPUTYPE}
+. else
+# CPUTYPE of i386+core2 matchine falls into prescott.
+CONFIGURE_ARGS+=	--cpu=${WITH_CPU}
+. endif
+.elifdef CPUTYPE
+CONFIGURE_ARGS+=	--cpu=${CPUTYPE}
+.endif
+
 ## a52
 .if !defined(WITHOUT_LIBA52) && !defined(WITHOUT_A52)
 LIB_DEPENDS+=	a52.0:${PORTSDIR}/audio/liba52
@@ -191,6 +208,31 @@
 CONFIGURE_ARGS+=	--enable-libxvid
 .endif
 
+## bktr
+.ifdef WITHOUT_BKTR
+CONFIGURE_ARGS+=	--disable-demuxer=bktr
+.else
+. ifdef WITH_BKTR_VIDEO_FORMAT
+FFMPEG_CFLAGS+=	-DVIDEO_FORMAT=${WITH_BKTR_VIDEO_FORMAT}
+. endif
+.endif
+
+## libamr-nb, libamr-wb
+.ifndef WITH_LIBAMR_NB && WITH_LIBAMR_WB \
+	&& !exists(${LOCALBASE}/lib/libamrnb.so) \
+	&& !exists(${LOCALBASE}/lib/libamrwb.so)
+CONFIGURE_ARGS+=	--disable-muxer=amr \
+			--disable-demuxer=amr
+.endif
+.ifdef WITH_LIBAMR_NB || exists(${LOCALBASE}/lib/libamrnb.so)
+LIB_DEPENDS+=		amrnb.3:${PORTSDIR}/audio/libamrnb
+CONFIGURE_ARGS+=	--enable-libamr-nb
+.endif
+.ifdef WITH_LIBAMR_WB || exists(${LOCALBASE}/lib/libamrwb.so)
+LIB_DEPENDS+=		amrwb.3:${PORTSDIR}/audio/libamrwb
+CONFIGURE_ARGS+=	--enable-libamr-wb
+.endif
+
 pre-everything::
 .ifndef(WITHOUT_A52)
 	@${ECHO_MSG} 'You can disable liba52 support by defining WITHOUT_LIBA52'


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-multimedia 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Nov 24 19:50:15 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118237 

From: "Tatsuki Makino" <tatsuki_makino@hotmail.com>
To: <bug-followup@FreeBSD.org>,
	<tatsuki_makino@hotmail.com>
Cc:  
Subject: Re: ports/118237: Ports: multimedia/ffmpeg fix configure option and add supports
Date: Sun, 20 Apr 2008 08:27:04 +0900

 Please give priority to ports/121636 and ports/120518.
 Afterwards, I rewrite the patch in the part that doesn't overlap.
 
 Or, please give priority to checking out a newer revision from svn. :-)

From: "Tatsuki Makino" <tatsuki_makino@hotmail.com>
To: <bug-followup@FreeBSD.org>,
	<tatsuki_makino@hotmail.com>
Cc:  
Subject: Re: ports/118237: Ports: multimedia/ffmpeg fix configure option and add supports
Date: Fri, 9 May 2008 18:38:10 +0900

 This is a multi-part message in MIME format.
 
 ------=_NextPart_000_002B_01C8B203.D511D1E0
 Content-Type: text/plain;
 	format=flowed;
 	charset="iso-2022-jp";
 	reply-type=original
 Content-Transfer-Encoding: 7bit
 
 This is new patch for ffmpeg-2007.10.04_4.
 
 I think that Makefile needs more cleanup.
 May I clean up it? 
 ------=_NextPart_000_002B_01C8B203.D511D1E0
 Content-Type: text/plain;
 	format=flowed;
 	name="patch-ffmpeg-PR118237.diff.txt";
 	reply-type=original
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
 	filename="patch-ffmpeg-PR118237.diff.txt"
 
 diff -u -r -N ../ffmpeg.orig/Makefile ./Makefile=0A=
 --- ../ffmpeg.orig/Makefile	2008-04-27 10:22:56.000000000 +0000=0A=
 +++ ./Makefile	2008-05-09 09:14:49.000000000 +0000=0A=
 @@ -23,6 +23,7 @@=0A=
  =0A=
  OPTIONS=3D	AMR_NB	"AMR narrowband encoder" off \=0A=
  		AMR_WB	"AMR wideband encoder" off \=0A=
 +		BKTR	"bktr(4) demuxer" on \=0A=
  		FAAC	"FAAC mp4/aac audio encoder" off \=0A=
  		FAAD	"FAAD mp4/aac audio decoder" on \=0A=
  		GSM	"gsm audio codec" off \=0A=
 @@ -39,7 +40,9 @@=0A=
  		VHOOK_IMLIB2 "imlib2 support (implies VHOOK)" off \=0A=
  		VORBIS	"libvorbisenc support (implies OGG)" on \=0A=
  		X264	"X.264 codec" on \=0A=
 -		XVID	"XVID codec" off=0A=
 +		XVID	"XVID codec" off \=0A=
 +		GCC42PLUS	"Build with GCC 4.2+" off \=0A=
 +		CPU	"Each CPU optimization" off=0A=
  =0A=
  .include <bsd.port.pre.mk>=0A=
  =0A=
 @@ -90,6 +93,24 @@=0A=
  DEBUG_FLAGS+=3D		 -O2=0A=
  .endif=0A=
  =0A=
 +.ifdef(WITH_CPU)=0A=
 +. if ${WITH_CPU} =3D=3D "true" || ${WITH_CPU:L} =3D=3D "yes"=0A=
 +.  ifdef(CPUTYPE)=0A=
 +CONFIGURE_ARGS+=3D	--cpu=3D${CPUTYPE}=0A=
 +.  endif=0A=
 +. else=0A=
 +CONFIGURE_ARGS+=3D	--cpu=3D${WITH_CPU}=0A=
 +. endif=0A=
 +.elifdef(CPUTYPE)=0A=
 +CONFIGURE_ARGS+=3D	--cpu=3D${CPUTYPE}=0A=
 +.endif=0A=
 +=0A=
 +.if ${OSVERSION} < 700042=0A=
 +. ifdef WITH_GCC42PLUS=0A=
 +USE_GCC=3D	4.2+=0A=
 +. endif=0A=
 +.endif=0A=
 +=0A=
  ## a52=0A=
  .if !defined(WITHOUT_LIBA52) && !defined(WITHOUT_A52)=0A=
  LIB_DEPENDS+=3D	a52.0:${PORTSDIR}/audio/liba52=0A=
 @@ -138,6 +159,16 @@=0A=
  CONFIGURE_ARGS+=3D	--disable-libamr-wb=0A=
  .endif=0A=
  =0A=
 +## bktr=0A=
 +.ifdef(WITHOUT_BKTR)=0A=
 +CONFIGURE_ARGS+=3D	--disable-demuxer=3Dbktr=0A=
 +.else=0A=
 +. ifdef(WITH_BKTR_VIDEO_FORMAT)=0A=
 +# PAL, NTSC, NTSCM, SECAM, PALN, PALM or NTSCJ=0A=
 +FFMPEG_CFLAGS+=3D	-DVIDEO_FORMAT=3D${WITH_BKTR_VIDEO_FORMAT}=0A=
 +. endif=0A=
 +.endif=0A=
 +=0A=
  USE_RC_SUBR=3D		ffserver=0A=
  =0A=
  .if ${MACHINE_CPU:Mmmx}=3D=3D""=0A=
 
 ------=_NextPart_000_002B_01C8B203.D511D1E0--
 
Responsible-Changed-From-To: freebsd-multimedia->mm 
Responsible-Changed-By: mm 
Responsible-Changed-When: Wed Aug 12 09:36:55 UTC 2009 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118237 
State-Changed-From-To: open->closed 
State-Changed-By: mm 
State-Changed-When: Wed Aug 12 09:40:59 UTC 2009 
State-Changed-Why:  
Obsolete, does not apply for latest version. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=118237 
>Unformatted:
