diff -Naur --exclude=CVS /usr/src/darwinports/dports/multimedia/ffmpeg/Portfile ./Portfile
--- /usr/src/darwinports/dports/multimedia/ffmpeg/Portfile	Mon Feb 21 11:31:26 2005
+++ ./Portfile	Sat Apr 16 00:01:19 2005
@@ -2,9 +2,9 @@
 
 PortSystem 1.0
 name		ffmpeg
-version		0.4.8
+version		0.4.9-devel
 categories	multimedia
-maintainers	ocheron@noos.fr
+maintainers	danchr@opendarwin.org ocheron@noos.fr
 description	Digital VCR and streaming server
 long_description	FFmpeg is a complete solution to record, convert and \
 			stream audio and video. It includes libavcodec, the \
@@ -31,14 +31,28 @@
 			libavformat is a library containing parsers and \
 			generators for all common audio/video formats.
 homepage        http://ffmpeg.sourceforge.net/
-master_sites	sourceforge:ffmpeg
-checksums	${distname}${extract.suffix} md5 e00d47614ba1afd99ad2ea387e782dd9
+master_sites	http://mplayerhq.hu/MPlayer/cvs/
+distname	FFMpeg-20050414
+checksums	sha1 d68745415f8891ecf017c1c97880b499a81642bf
+use_bzip2	yes
 platforms       darwin
-configure.env	CFLAGS="-I${prefix}/include"
-configure.args	--prefix=${destroot}${prefix} --disable-vhook \
-		--mandir=${destroot}${prefix}/share/man \
-		--extra-ldflags="-d -L${prefix}/lib"
-patchfiles	patch-configure.diff
+configure.args	--prefix=${prefix} --mandir=${prefix}/share/man \
+		--extra-ldflags="-L${prefix}/lib" \
+		--extra-cflags="-I${prefix}/include" \
+		--enable-shared --enable-gpl --enable-pthreads --disable-vhook \
+		--enable-mp3lame --enable-a52 --enable-dts --enable-faac \
+		--enable-faad --enable-shared-pp --enable-pp --enable-x264 \
+		--enable-xvid --enable-libogg --enable-vorbis \
+		--disable-strip --disable-debug
+
+patchfiles	patch-libavformat-Makefile patch-libavcodec-Makefile \
+		patch-libavcodec-libpostproc-Makefile patch-configure \
+		patch-Makefile
+
+depends_build	lib:libx264:x264
+depends_lib	lib:libmp3lame:lame lib:liba52:a52dec lib:libfaac:faac \
+		lib:libfaad:faad2 lib:libxvidcore:xvid lib:libogg:libogg \
+		lib:libvorbis:libvorbis lib:libz:zlib lib:libdts:libdts
 
 post-destroot {
 	file mkdir ${destroot}/${prefix}/share/doc/${name}
@@ -46,22 +60,4 @@
 	foreach f [glob ${worksrcpath}/doc/*.txt ${worksrcpath}/doc/*.html] {
 		file copy $f ${destroot}/${prefix}/share/doc/${name}
 	}
-}
-
-# Adds MP3 support
-variant mp3 {
-	depends_lib-append lib:XXX:lame
-	configure.args-append --enable-mp3lame
-}
-
-# Adds Ogg Vorbis support
-variant ogg-vorbis {
-	depends_lib-append lib:XXX:libvorbis
-	configure.args-append --enable-vorbis
-}
-
-# Adds AAC support
-variant aac {
-	depends_lib-append lib:XXX:faad2
-	configure.args-append --enable-faad
 }
diff -Naur --exclude=CVS /usr/src/darwinports/dports/multimedia/ffmpeg/files/patch-Makefile ./files/patch-Makefile
--- /usr/src/darwinports/dports/multimedia/ffmpeg/files/patch-Makefile	Thu Jan  1 01:00:00 1970
+++ ./files/patch-Makefile	Fri Apr 15 23:15:12 2005
@@ -0,0 +1,44 @@
+--- Makefile.orig	Fri Apr 15 23:14:34 2005
++++ Makefile	Fri Apr 15 23:14:44 2005
+@@ -36,6 +36,10 @@
+ 
+ ifeq ($(BUILD_SHARED),yes)
+ DEP_LIBS=libavcodec/$(SLIBPREF)avcodec$(SLIBSUF) libavformat/$(SLIBPREF)avformat$(SLIBSUF)
++ifeq ($(CONFIG_DARWIN),yes)
++LDFLAGS+=$(foreach l,$(DEP_LIBS) libavcodec/libpostproc/libpostproc$(SLIBSUF), \
++	-dylib_file $(libdir)/$(notdir $l):$l)
++endif
+ else
+ DEP_LIBS=libavcodec/$(LIBPREF)avcodec$(LIBSUF) libavformat/$(LIBPREF)avformat$(LIBSUF)
+ ifeq ($(CONFIG_MP3LAME),yes)
+@@ -91,7 +95,7 @@
+ 
+ OBJS = ffmpeg.o ffserver.o cmdutils.o $(FFPLAY_O)
+ SRCS = $(OBJS:.o=.c) $(ASM_OBJS:.o=.s)
+-FFLIBS = -L./libavformat -lavformat -L./libavcodec -lavcodec
++FFLIBS = -L./libavformat -lavformat -L./libavcodec -L./libavcodec/libpostproc -lavcodec
+ 
+ all: lib $(PROG) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
+ 
+@@ -142,8 +146,8 @@
+ install: all install-man $(INSTALLVHOOK)
+ 	$(MAKE) -C libavcodec install
+ 	$(MAKE) -C libavformat install
+-	install -d "$(bindir)"
+-	install -c $(INSTALLSTRIP) -m 755 $(PROG) "$(bindir)"
++	install -d "$(DESTDIR)$(bindir)"
++	install -c $(INSTALLSTRIP) -m 755 $(PROG) "$(DESTDIR)$(bindir)"
+ 
+ # create the window installer
+ wininstaller: all install
+@@ -153,8 +157,8 @@
+ install-man:
+ ifneq ($(CONFIG_WIN32),yes)
+ 	if [ -f doc/ffmpeg.1 ] ; then \
+-	    install -d "$(mandir)/man1" ; \
+-	    install -m 644 $(MANPAGE) "$(mandir)/man1" ; \
++	    install -d "$(DESTDIR)$(mandir)/man1" ; \
++	    install -m 644 $(MANPAGE) "$(DESTDIR)$(mandir)/man1" ; \
+ 	fi
+ endif
+ 
diff -Naur --exclude=CVS /usr/src/darwinports/dports/multimedia/ffmpeg/files/patch-configure ./files/patch-configure
--- /usr/src/darwinports/dports/multimedia/ffmpeg/files/patch-configure	Thu Jan  1 01:00:00 1970
+++ ./files/patch-configure	Fri Apr 15 20:20:23 2005
@@ -0,0 +1,25 @@
+Index: configure
+===================================================================
+RCS file: /cvsroot/ffmpeg/ffmpeg/configure,v
+retrieving revision 1.167
+diff -a -u -u -r1.167 configure
+--- configure	9 Apr 2005 15:32:58 -0000	1.167
++++ configure	15 Apr 2005 18:20:30 -0000
+@@ -279,12 +279,13 @@
+ audio_oss="no"
+ dv1394="no"
+ ffserver="no"
+-SHFLAGS="-dynamiclib"
+-extralibs=""
++SHFLAGS="-dynamiclib -single_module"
++SLIBSUF=.dylib
++extralibs="-lmx"
+ darwin="yes"
+ strip="strip -x"
+-LDFLAGS="-Wl,-d,-search_paths_first"
+-FFSLDFLAGS=-Wl,-bind_at_load
++LDFLAGS="-Wl,-search_paths_first"
++FFSLDFLAGS=
+ ;;
+ MINGW32*)
+ # Note: the rest of the mingw32 config is done afterwards as mingw32
diff -Naur --exclude=CVS /usr/src/darwinports/dports/multimedia/ffmpeg/files/patch-configure.diff ./files/patch-configure.diff
--- /usr/src/darwinports/dports/multimedia/ffmpeg/files/patch-configure.diff	Thu Jan 29 05:48:09 2004
+++ ./files/patch-configure.diff	Thu Jan  1 01:00:00 1970
@@ -1,27 +0,0 @@
---- configure	Sun Sep 28 17:26:39 2003
-+++ configure.diff	Wed Jan 14 10:59:52 2004
-@@ -163,6 +163,7 @@
- make="gmake"
- ;;
- Darwin)
-+SLIBSUF=".dylib"
- cc="cc"
- v4l="no"
- audio_oss="no"
-@@ -177,13 +178,13 @@
- gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
- case "$gcc_version" in
- *2.95*) 
--CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer"
-+CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
- ;;
- *3.3*) 
--CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL"
-+CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL"
- ;;
- *) 
--CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic"
-+CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic"
- ;;
- esac
- ;;
diff -Naur --exclude=CVS /usr/src/darwinports/dports/multimedia/ffmpeg/files/patch-libavcodec-Makefile ./files/patch-libavcodec-Makefile
--- /usr/src/darwinports/dports/multimedia/ffmpeg/files/patch-libavcodec-Makefile	Thu Jan  1 01:00:00 1970
+++ ./files/patch-libavcodec-Makefile	Fri Apr 15 20:49:28 2005
@@ -0,0 +1,67 @@
+Index: libavcodec/Makefile
+===================================================================
+RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/Makefile,v
+retrieving revision 1.182
+diff -a -u -u -r1.182 Makefile
+--- libavcodec/Makefile	3 Apr 2005 05:02:08 -0000	1.182
++++ libavcodec/Makefile	15 Apr 2005 18:49:35 -0000
+@@ -223,6 +223,10 @@
+ 	$(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
+ 	$(RANLIB) $@
+ 
++ifeq ($(CONFIG_DARWIN), yes)
++SHFLAGS+=-install_name $(libdir)/$(SLIB)
++endif
++
+ $(SLIB): $(OBJS)
+ ifeq ($(CONFIG_PP),yes)
+ 	$(MAKE) -C libpostproc
+@@ -251,7 +255,7 @@
+ dep:	depend
+ 
+ clean: $(CLEANAMR)
+-	rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *.so i386/*.o i386/*~ \
++	rm -f *.o *.d *~ .depend $(LIB) $(SLIB) *$(SLIBSUF) i386/*.o i386/*~ \
+ 	   armv4l/*.o armv4l/*~ \
+ 	   mlib/*.o mlib/*~ \
+ 	   alpha/*.o alpha/*~ \
+@@ -300,13 +304,17 @@
+ ifeq ($(BUILD_SHARED),yes)
+ install: all install-headers
+ ifeq ($(CONFIG_WIN32),yes)
+-	install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
++	install $(INSTALLSTRIP) -m 755 $(SLIB) "$(DESTDIR)$(prefix)"
+ else
+-	install -d $(libdir)
+-	install $(INSTALLSTRIP) -m 755 $(SLIB) $(libdir)/libavcodec-$(VERSION).so
+-	ln -sf libavcodec-$(VERSION).so $(libdir)/libavcodec.so
++	install -d $(DESTDIR)$(libdir)
++ifeq ($(CONFIG_DARWIN),yes)
++	install $(INSTALLSTRIP) -m 755 $(SLIB) $(DESTDIR)$(libdir)/$(SLIB)
++else
++	install $(INSTALLSTRIP) -m 755 $(SLIB) $(DESTDIR)$(libdir)/libavcodec-$(VERSION).so
++	ln -sf libavcodec-$(VERSION).so $(DESTDIR)$(libdir)/libavcodec.so
+ 	ldconfig || true
+ endif
++endif
+ ifeq ($(CONFIG_PP),yes)
+ 	$(MAKE) -C libpostproc $@
+ endif
+@@ -315,14 +323,14 @@
+ endif
+ 
+ installlib: all install-headers
+-	install -m 644 $(LIB) "$(libdir)"
++	install -m 644 $(LIB) "$(DESTDIR)$(libdir)"
+ 
+ install-headers:
+-	mkdir -p "$(prefix)/include/ffmpeg"
++	mkdir -p "$(DESTDIR)$(prefix)/include/ffmpeg"
+ 	install -m 644 $(SRC_PATH)/libavcodec/avcodec.h \
+ 	               $(SRC_PATH)/libavcodec/common.h \
+ 	               $(SRC_PATH)/libavcodec/rational.h \
+-                "$(prefix)/include/ffmpeg"
++                "$(DESTDIR)$(prefix)/include/ffmpeg"
+ 
+ #
+ # include dependency files if they exist
diff -Naur --exclude=CVS /usr/src/darwinports/dports/multimedia/ffmpeg/files/patch-libavcodec-libpostproc-Makefile ./files/patch-libavcodec-libpostproc-Makefile
--- /usr/src/darwinports/dports/multimedia/ffmpeg/files/patch-libavcodec-libpostproc-Makefile	Thu Jan  1 01:00:00 1970
+++ ./files/patch-libavcodec-libpostproc-Makefile	Fri Apr 15 20:49:29 2005
@@ -0,0 +1,75 @@
+Index: libavcodec/libpostproc/Makefile
+===================================================================
+RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/libpostproc/Makefile,v
+retrieving revision 1.21
+diff -a -u -u -r1.21 Makefile
+--- libavcodec/libpostproc/Makefile	23 Mar 2005 14:10:22 -0000	1.21
++++ libavcodec/libpostproc/Makefile	15 Apr 2005 18:49:36 -0000
+@@ -15,6 +15,12 @@
+ CFLAGS  = $(OPTFLAGS) $(MLIB_INC) -I. -I.. $(EXTRA_INC)
+ # -I/usr/X11R6/include/
+ 
++ifeq ($(CONFIG_DARWIN), yes)
++SHFLAGS+=-install_name $(libdir)/$(SPPLIB) -compatibility_version $(SPPVERSION) -current_version $(SPPVERSION)
++else
++SHFLAGS+=-Wl,-soname,$(SPPLIB).0
++endif
++
+ .SUFFIXES: .c .o
+ 
+ # .PHONY: all clean
+@@ -25,10 +31,10 @@
+ all:    $(SWSLIB) $(PPLIB) $(SPPLIB)
+ 
+ clean:
+-	rm -f *.o *.a *~ *.so $(PPLIB) $(SPPLIB)
++	rm -f *.o *.a *~ *$(SLIBSUF) $(PPLIB) $(SPPLIB)
+ 
+ distclean:
+-	rm -f Makefile.bak *.o *.a *~ *.so .depend
++	rm -f Makefile.bak *.o *.a *~ *$(SLIBSUF) .depend
+ 
+ dep:    depend
+ 
+@@ -37,11 +43,10 @@
+ 
+ ifeq ($(SHARED_PP),yes)
+ postprocess_pic.o: postprocess.c
+-	$(CC) -c $(CFLAGS) -fomit-frame-pointer -fPIC -DPIC -I.. -I../.. -o $@ $<
++	$(CC) -c $(SHCFLAGS) -fomit-frame-pointer $(PIC) -I.. -I../.. -o $@ $<
+ 
+ $(SPPLIB): $(SPPOBJS)
+-	$(CC) -shared -Wl,-soname,$(SPPLIB).0 \
+-	-o $(SPPLIB) $(SPPOBJS)
++	$(CC) $(SHFLAGS) -o $(SPPLIB) $(SPPOBJS)
+ endif
+ 
+ $(PPLIB): $(PPOBJS)
+@@ -52,16 +57,21 @@
+ install: all
+ ifeq ($(SHARED_PP),yes)
+ ifeq ($(CONFIG_WIN32),yes)
+-	install $(INSTALLSTRIP) -m 755 $(SPPLIB) "$(prefix)"
++	install $(INSTALLSTRIP) -m 755 $(SPPLIB) "$(DESTDIR)$(prefix)"
+ else
+-	install -d $(libdir)
+-	install $(INSTALLSTRIP) -m 755 $(SPPLIB) $(libdir)/$(SPPLIB).$(SPPVERSION)
+-	ln -sf $(SPPLIB).$(SPPVERSION) $(libdir)/$(SPPLIB)
++	install -d $(DESTDIR)$(libdir)
++ifeq ($(CONFIG_DARWIN),yes)
++	install $(INSTALLSTRIP) -m 755 $(SPPLIB) $(DESTDIR)$(libdir)/$(SPPLIB:$(SLIBSUF)=.$(SPPVERSION)$(SLIBSUF))
++	ln -sf $(SPPLIB:$(SLIBSUF)=.$(SPPVERSION)$(SLIBSUF)) $(DESTDIR)$(libdir)/$(SPPLIB)
++else
++	install $(INSTALLSTRIP) -m 755 $(SPPLIB) $(DESTDIR)$(libdir)/$(SPPLIB).$(SPPVERSION)
++	ln -sf $(SPPLIB).$(SPPVERSION) $(DESTDIR)$(libdir)/$(SPPLIB)
+ 	ldconfig || true
+ endif
+ endif
+-	mkdir -p $(prefix)/include/postproc
+-	install -m 644 postprocess.h $(prefix)/include/postproc/postprocess.h
++endif
++	mkdir -p $(DESTDIR)$(prefix)/include/postproc
++	install -m 644 postprocess.h $(DESTDIR)$(prefix)/include/postproc/postprocess.h
+ 
+ 
+ #
diff -Naur --exclude=CVS /usr/src/darwinports/dports/multimedia/ffmpeg/files/patch-libavformat-Makefile ./files/patch-libavformat-Makefile
--- /usr/src/darwinports/dports/multimedia/ffmpeg/files/patch-libavformat-Makefile	Thu Jan  1 01:00:00 1970
+++ ./files/patch-libavformat-Makefile	Fri Apr 15 20:49:29 2005
@@ -0,0 +1,80 @@
+Index: libavformat/Makefile
+===================================================================
+RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/Makefile,v
+retrieving revision 1.86
+diff -a -u -u -r1.86 Makefile
+--- libavformat/Makefile	9 Apr 2005 15:32:58 -0000	1.86
++++ libavformat/Makefile	15 Apr 2005 18:49:37 -0000
+@@ -67,6 +67,7 @@
+ 
+ ifeq ($(CONFIG_LIBOGG),yes)
+ OBJS+= ogg.o
++EXTRALIBS += -logg
+ endif
+ 
+ ifeq ($(TARGET_ARCH_SPARC64),yes)
+@@ -77,7 +78,7 @@
+ ifeq ($(BUILD_SHARED),yes)
+ SLIB= $(SLIBPREF)avformat$(SLIBSUF)
+ 
+-AVCLIBS+=-lavcodec -L../libavcodec
++AVCLIBS+=-lavcodec -L../libavcodec/libpostproc -L../libavcodec
+ ifeq ($(CONFIG_MP3LAME),yes)
+ AVCLIBS+=-lmp3lame
+ endif
+@@ -92,12 +93,16 @@
+ 	$(AR) rc $@ $(OBJS) $(PPOBJS)
+ 	$(RANLIB) $@
+ 
++ifeq ($(CONFIG_DARWIN), yes)
++SHFLAGS+=-install_name $(libdir)/$(SLIB)
++endif
++
+ $(SLIB): $(OBJS)
+ ifeq ($(CONFIG_WIN32),yes)
+ 	$(CC) $(SHFLAGS) -Wl,--output-def,$(@:.dll=.def) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
+ 	-lib /machine:i386 /def:$(@:.dll=.def)
+ else
+-	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS)
++	$(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(AVCLIBS) $(EXTRALIBS) $(LDFLAGS)
+ endif
+ 
+ depend: $(SRCS)
+@@ -106,26 +111,30 @@
+ ifeq ($(BUILD_SHARED),yes)
+ install: all install-headers
+ ifeq ($(CONFIG_WIN32),yes)
+-	install $(INSTALLSTRIP) -m 755 $(SLIB) "$(prefix)"
++	install $(INSTALLSTRIP) -m 755 $(SLIB) "$(DESTDIR)$(prefix)"
+ else
+-	install -d $(libdir)
+-	install $(INSTALLSTRIP) -m 755 $(SLIB) $(libdir)/libavformat-$(VERSION).so
+-	ln -sf libavformat-$(VERSION).so $(libdir)/libavformat.so
++	install -d $(DESTDIR)$(libdir)
++ifeq ($(CONFIG_DARWIN),yes)
++	install $(INSTALLSTRIP) -m 755 $(SLIB) $(DESTDIR)$(libdir)/
++else
++	install $(INSTALLSTRIP) -m 755 $(SLIB) $(DESTDIR)$(libdir)/libavformat-$.(VERSION).so
++	ln -sf libavformat-$(VERSION).so $(DESTDIR)$(libdir)/libavformat.so
+ 	ldconfig || true
+ endif
++endif
+ else
+ install:
+ endif
+ 
+ installlib: all install-headers
+-	install -m 644 $(LIB) "$(libdir)"
++	install -m 644 $(LIB) "$(DESTDIR)$(libdir)"
+ 
+ install-headers:
+-	mkdir -p "$(prefix)/include/ffmpeg"
++	mkdir -p "$(DESTDIR)$(prefix)/include/ffmpeg"
+ 	install -m 644 $(SRC_PATH)/libavformat/avformat.h $(SRC_PATH)/libavformat/avio.h \
+                 $(SRC_PATH)/libavformat/rtp.h $(SRC_PATH)/libavformat/rtsp.h \
+                 $(SRC_PATH)/libavformat/rtspcodes.h \
+-                "$(prefix)/include/ffmpeg"
++                "$(DESTDIR)$(prefix)/include/ffmpeg"
+ 
+ %.o: %.c
+ 	$(CC) $(CFLAGS) -c -o $@ $< 
