summaryrefslogtreecommitdiff
path: root/multimedia/ffmpeg/patches
diff options
context:
space:
mode:
authorahoka <ahoka>2008-09-07 23:39:37 +0000
committerahoka <ahoka>2008-09-07 23:39:37 +0000
commitaf2187e720492c0c8bd70f7f9e73259b154b0207 (patch)
tree5824d21ef77d63b3abef1650041477ee16a3c3eb /multimedia/ffmpeg/patches
parent1fcccc55480b2f833149ce75c9755d35fbbe705d (diff)
downloadpkgsrc-af2187e720492c0c8bd70f7f9e73259b154b0207.tar.gz
Track FreeBSD's SVN snapshots of ffmpeg as there are no more stable
releases produced by the ffmpeg team. Add v4l2 support for NetBSD.
Diffstat (limited to 'multimedia/ffmpeg/patches')
-rw-r--r--multimedia/ffmpeg/patches/patch-aa35
-rw-r--r--multimedia/ffmpeg/patches/patch-ab22
-rw-r--r--multimedia/ffmpeg/patches/patch-ac125
-rw-r--r--multimedia/ffmpeg/patches/patch-ad75
-rw-r--r--multimedia/ffmpeg/patches/patch-ae77
-rw-r--r--multimedia/ffmpeg/patches/patch-af80
-rw-r--r--multimedia/ffmpeg/patches/patch-ag194
-rw-r--r--multimedia/ffmpeg/patches/patch-ah18
-rw-r--r--multimedia/ffmpeg/patches/patch-ai19
-rw-r--r--multimedia/ffmpeg/patches/patch-aj60
-rw-r--r--multimedia/ffmpeg/patches/patch-ak17
-rw-r--r--multimedia/ffmpeg/patches/patch-al52
-rw-r--r--multimedia/ffmpeg/patches/patch-an21
-rw-r--r--multimedia/ffmpeg/patches/patch-ao13
-rw-r--r--multimedia/ffmpeg/patches/patch-bktr13
-rw-r--r--multimedia/ffmpeg/patches/patch-configure21
-rw-r--r--multimedia/ffmpeg/patches/patch-r1447716
-rw-r--r--multimedia/ffmpeg/patches/patch-v4l220
18 files changed, 70 insertions, 808 deletions
diff --git a/multimedia/ffmpeg/patches/patch-aa b/multimedia/ffmpeg/patches/patch-aa
deleted file mode 100644
index 7947e58f8a1..00000000000
--- a/multimedia/ffmpeg/patches/patch-aa
+++ /dev/null
@@ -1,35 +0,0 @@
-$NetBSD: patch-aa,v 1.7 2007/12/22 00:05:25 joerg Exp $
-
---- configure.orig 2004-07-05 21:06:16.000000000 +0300
-+++ configure
-@@ -224,11 +224,10 @@ FFSLDFLAGS=""
- need_inet_aton="yes"
- extralibs="$extralibs -lsocket -lnsl"
- ;;
--FreeBSD)
-+FreeBSD|NetBSD|DragonFly)
- v4l="no"
- audio_oss="yes"
- dv1394="no"
--make="gmake"
- CFLAGS="-pthread"
- LDFLAGS="$LDFLAGS -export-dynamic -pthread"
- ;;
-@@ -244,7 +243,6 @@ cc="cc"
- v4l="no"
- audio_oss="no"
- dv1394="no"
--ffserver="no"
- SHFLAGS="-dynamiclib"
- extralibs=""
- darwin="yes"
-@@ -1140,8 +1138,8 @@ fi
- if test "$vhook" = "yes" ; then
- echo "BUILD_VHOOK=yes" >> config.mak
- echo "#define HAVE_VHOOK 1" >> $TMPH
-- extralibs="$extralibs $ldl"
- fi
-+extralibs="$extralibs $ldl"
- if test "$lshared" = "yes" ; then
- echo "BUILD_SHARED=yes" >> config.mak
- echo "PIC=-fPIC" >> config.mak
diff --git a/multimedia/ffmpeg/patches/patch-ab b/multimedia/ffmpeg/patches/patch-ab
deleted file mode 100644
index 214ef626486..00000000000
--- a/multimedia/ffmpeg/patches/patch-ab
+++ /dev/null
@@ -1,22 +0,0 @@
-$NetBSD: patch-ab,v 1.4 2006/06/26 19:39:54 wiz Exp $
-
---- ffserver.c.orig 2004-05-29 02:06:31.000000000 +0000
-+++ ffserver.c
-@@ -4375,7 +4375,7 @@ static void show_help(void)
- "\n"
- "-L : print the LICENSE\n"
- "-h : this help\n"
-- "-f configfile : use configfile instead of /etc/ffserver.conf\n"
-+ "-f configfile : use configfile instead of " FFSERVER_CONF "\n"
- );
- }
-
-@@ -4433,7 +4433,7 @@ int main(int argc, char **argv)
-
- av_register_all();
-
-- config_filename = "/etc/ffserver.conf";
-+ config_filename = FFSERVER_CONF;
-
- my_program_name = argv[0];
- my_program_dir = getcwd(0, 0);
diff --git a/multimedia/ffmpeg/patches/patch-ac b/multimedia/ffmpeg/patches/patch-ac
deleted file mode 100644
index 7dfe0239b1b..00000000000
--- a/multimedia/ffmpeg/patches/patch-ac
+++ /dev/null
@@ -1,125 +0,0 @@
-$NetBSD: patch-ac,v 1.5 2007/12/22 00:05:25 joerg Exp $
-
---- Makefile.orig 2004-07-08 13:02:04.000000000 +0200
-+++ Makefile
-@@ -5,9 +5,7 @@
- include config.mak
-
- VPATH=$(SRC_PATH)
--
--CFLAGS=$(OPTFLAGS) -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
--LDFLAGS+= -g
-+CFLAGS= $(SHCFLAGS) -Wall -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
-
- ifeq ($(TARGET_GPROF),yes)
- CFLAGS+=-p
-@@ -46,6 +44,8 @@ ifeq ($(CONFIG_VORBIS),yes)
- EXTRALIBS+=-logg -lvorbis -lvorbisenc
- endif
-
-+EXTRALIBS+=${LIBOSSAUDIO}
-+
- ifeq ($(CONFIG_FAAD),yes)
- ifeq ($(CONFIG_FAADBIN),yes)
- # no libs needed
-@@ -76,7 +76,7 @@ endif
-
- 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 = libavformat/libavformat.la libavcodec/libavcodec.la
-
- all: lib $(PROG) $(PROGTEST) $(VHOOK) $(QTFASTSTART) $(DOC)
-
-@@ -84,25 +84,18 @@ lib:
- $(MAKE) -C libavcodec all
- $(MAKE) -C libavformat all
-
--ffmpeg_g$(EXESUF): ffmpeg.o cmdutils.o .libs
-- $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
--
--ffmpeg$(EXESUF): ffmpeg_g$(EXESUF)
-- cp -p $< $@
-- $(STRIP) $@
-+ffmpeg$(EXESUF): ffmpeg.o cmdutils.o .ffmpeglibs
-+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ ffmpeg.o cmdutils.o $(FFLIBS) $(EXTRALIBS)
-
--ffserver$(EXESUF): ffserver.o .libs
-- $(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
-+ffserver$(EXESUF): ffserver.o .ffmpeglibs
-+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(FFSLDFLAGS) -o $@ ffserver.o $(FFLIBS) $(EXTRALIBS)
-
--ffplay_g$(EXESUF): ffplay.o cmdutils.o .libs
-- $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
-
--ffplay$(EXESUF): ffplay_g$(EXESUF)
-- cp -p $< $@
-- $(STRIP) $@
-+ffplay$(EXESUF): ffplay.o cmdutils.o .ffmpeglibs
-+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ ffplay.o cmdutils.o $(FFLIBS) $(EXTRALIBS) $(SDL_LIBS)
-
--output_example$(EXESUF): output_example.o .libs
-- $(CC) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
-+output_example$(EXESUF): output_example.o .ffmpeglibs
-+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ output_example.o $(FFLIBS) $(EXTRALIBS)
-
- qt-faststart$(EXESUF): qt-faststart.c
- $(CC) qt-faststart.c -o qt-faststart$(EXESUF)
-@@ -111,9 +104,9 @@ ffplay.o: ffplay.c
- $(CC) $(CFLAGS) $(SDL_CFLAGS) -c -o $@ $<
-
- %.o: %.c
-- $(CC) $(CFLAGS) -c -o $@ $<
-+ $(CC) -DFFSERVER_CONF=\"$(FFSERVER_CONF)\" $(CFLAGS) -c -o $@ $<
-
--videohook: .libs
-+videohook: .ffmpeglibs
- $(MAKE) -C vhook all
-
- documentation:
-@@ -122,10 +115,10 @@ documentation:
- .PHONY: install
-
- install: all install-man $(INSTALLVHOOK)
-- $(MAKE) -C libavcodec install
-- $(MAKE) -C libavformat install
-- install -d "$(bindir)"
-- install -c -s -m 755 $(PROG) "$(bindir)"
-+ $(MAKE) -C libavcodec install install-headers
-+ $(MAKE) -C libavformat install install-headers
-+ install -d "${DESTDIR}$(bindir)"
-+ $(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(bindir)
-
- # create the window installer
- wininstaller: all install
-@@ -135,8 +128,8 @@ wininstaller: all install
- install-man:
- ifneq ($(CONFIG_WIN32),yes)
- if [ -f $(SRC_PATH)/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
-
-@@ -159,15 +152,15 @@ endif
- .depend: $(SRCS)
- $(CC) -MM $(CFLAGS) $(SDL_CFLAGS) $^ 1>.depend
-
--.libs: lib
-- @test -f .libs || touch .libs
-- @for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .libs ; then touch .libs; fi ; done
-+.ffmpeglibs: lib
-+ @test -f .ffmpeglibs || touch .ffmpeglibs
-+ @for i in $(DEP_LIBS) ; do if $(TEST) $$i -nt .ffmpeglibs ; then touch .ffmpeglibs; fi ; done
-
- clean: $(CLEANVHOOK)
- $(MAKE) -C libavcodec clean
- $(MAKE) -C libavformat clean
- $(MAKE) -C tests clean
-- rm -f *.o *.d *~ .libs .depend gmon.out TAGS ffmpeg_g$(EXESUF) ffplay_g$(EXESUF) $(PROG) $(PROGTEST)
-+ rm -f *.o *.d *~ .ffmpeglibs .depend gmon.out TAGS ffmpeg_g$(EXESUF) ffplay_g$(EXESUF) $(PROG) $(PROGTEST)
-
- clean-vhook:
- $(MAKE) -C vhook clean
diff --git a/multimedia/ffmpeg/patches/patch-ad b/multimedia/ffmpeg/patches/patch-ad
deleted file mode 100644
index 6f05ce0b0dd..00000000000
--- a/multimedia/ffmpeg/patches/patch-ad
+++ /dev/null
@@ -1,75 +0,0 @@
-$NetBSD: patch-ad,v 1.6 2007/12/22 00:05:25 joerg Exp $
-
---- libavformat/Makefile.orig 2004-04-24 17:16:23.000000000 +0200
-+++ libavformat/Makefile
-@@ -6,7 +6,7 @@ include ../config.mak
-
- VPATH=$(SRC_PATH)/libavformat
-
--CFLAGS=$(OPTFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
-+CFLAGS=$(SHCFLAGS) -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
-
- OBJS= utils.o cutils.o os_support.o allformats.o
- PPOBJS=
-@@ -68,6 +68,11 @@ endif
-
- ifeq ($(CONFIG_VORBIS),yes)
- OBJS+= ogg.o
-+EXTRALIBS+= -lvorbis -lvorbisenc
-+endif
-+
-+ifeq ($(CONFIG_MP3LAME),yes)
-+EXTRALIBS += -lmp3lame
- endif
-
- ifeq ($(TARGET_ARCH_SPARC64),yes)
-@@ -81,12 +86,14 @@ endif
-
- SRCS := $(OBJS:.o=.c) $(PPOBJS:.o=.cpp)
-
-+install: all
-+ $(LIBTOOL) --mode=install $(BSD_INSTALL_LIB) $(LIB:.a=.la) ${DESTDIR}$(prefix)/lib
-+
- all: $(LIB) $(SLIB)
-
- $(LIB): $(OBJS) $(PPOBJS)
- rm -f $@
-- $(AR) rc $@ $(OBJS) $(PPOBJS)
-- $(RANLIB) $@
-+ $(LIBTOOL) --mode=link $(CC) -o $(LIB:.a=.la) $(OBJS:.o=.lo) $(PPOBJS:.o=.lo) -rpath $(prefix)/lib $(LIBOSSAUDIO) $(EXTRALIBS)
-
- $(SLIB): $(OBJS)
- ifeq ($(CONFIG_WIN32),yes)
-@@ -96,9 +103,6 @@ else
- $(CC) $(SHFLAGS) -o $@ $(OBJS) $(PPOBJS) $(EXTRALIBS)
- endif
-
--depend: $(SRCS)
-- $(CC) -MM $(CFLAGS) $^ 1>.depend
--
- ifeq ($(BUILD_SHARED),yes)
- install: all install-headers
- ifeq ($(CONFIG_WIN32),yes)
-@@ -117,18 +121,18 @@ installlib: all install-headers
- install -m 644 $(LIB) $(prefix)/lib
-
- 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 $@ $<
-+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
-
- # BeOS: remove -Wall to get rid of all the "multibyte constant" warnings
- %.o: %.cpp
-- g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
-+ $(LIBTOOL) --mode=compile $(CXX) $(subst -Wall,,$(CFLAGS)) -c -o $@ $<
-
- distclean clean:
- rm -f *.o *.d .depend *~ *.a $(LIB)
diff --git a/multimedia/ffmpeg/patches/patch-ae b/multimedia/ffmpeg/patches/patch-ae
deleted file mode 100644
index f76ddfa2d0d..00000000000
--- a/multimedia/ffmpeg/patches/patch-ae
+++ /dev/null
@@ -1,77 +0,0 @@
-$NetBSD: patch-ae,v 1.8 2007/12/22 00:05:25 joerg Exp $
-
---- libavcodec/Makefile.orig 2004-06-18 15:11:15.000000000 +0200
-+++ libavcodec/Makefile
-@@ -7,7 +7,7 @@ include ../config.mak
- VPATH=$(SRC_PATH)/libavcodec
-
- # NOTE: -I.. is needed to include config.h
--CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
-+CFLAGS=$(SHCFLAGS) -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
-
- OBJS= common.o utils.o mem.o allcodecs.o \
- mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
-@@ -165,7 +165,7 @@ endif
- ifeq ($(TARGET_ARCH_SPARC),yes)
- OBJS+=sparc/dsputil_vis.o
- sparc/%.o: sparc/%.c
-- $(CC) -mcpu=ultrasparc -mtune=ultrasparc $(CFLAGS) -c -o $@ $<
-+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
- endif
- ifeq ($(TARGET_ARCH_SPARC64),yes)
- CFLAGS+= -mcpu=ultrasparc -mtune=ultrasparc
-@@ -180,6 +180,9 @@ SLIB= $(SLIBPREF)avcodec$(SLIBSUF)
- endif
- TESTS= imgresample-test dct-test motion-test fft-test
-
-+install: all
-+ $(LIBTOOL) --mode=install $(BSD_INSTALL_LIB) $(LIB:.a=.la) ${DESTDIR}$(prefix)/lib
-+
- all: $(LIB) $(SLIB)
-
- amrlibs:
-@@ -189,8 +192,8 @@ tests: apiexample cpuid_test $(TESTS)
-
- $(LIB): $(OBJS) $(AMRLIBS)
- rm -f $@
-- $(AR) rc $@ $(OBJS) $(AMREXTRALIBS)
-- $(RANLIB) $@
-+ $(LIBTOOL) --mode=link $(CC) -o $(LIB:.a=.la) $(OBJS:.o=.lo) -rpath $(prefix)/lib $(EXTRALIBS) $(AMREXTRALIBS)
-+
-
- $(SLIB): $(OBJS)
- ifeq ($(CONFIG_WIN32),yes)
-@@ -206,13 +209,10 @@ libpostproc/libpostproc.a:
- $(MAKE) -C libpostproc
-
- %.o: %.c
-- $(CC) $(CFLAGS) -c -o $@ $<
-+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
-
- %.o: %.S
-- $(CC) $(CFLAGS) -c -o $@ $<
--
--depend: $(SRCS)
-- $(CC) -MM $(CFLAGS) $^ 1>.depend
-+ $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
-
- dep: depend
-
-@@ -278,14 +278,14 @@ install:
- endif
-
- installlib: all install-headers
-- install -m 644 $(LIB) $(prefix)/lib
-+ install -m 644 $(LIB) ${DESTDIR}$(prefix)/lib
-
- 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 --git a/multimedia/ffmpeg/patches/patch-af b/multimedia/ffmpeg/patches/patch-af
deleted file mode 100644
index 03a7ee1bd15..00000000000
--- a/multimedia/ffmpeg/patches/patch-af
+++ /dev/null
@@ -1,80 +0,0 @@
-$NetBSD: patch-af,v 1.5 2006/02/16 10:26:30 abs Exp $
-
---- libavcodec/utils.c.orig 2006-02-06 23:52:35.000000000 +0000
-+++ libavcodec/utils.c
-@@ -210,26 +210,10 @@ int avcodec_default_get_buffer(AVCodecCo
- buf->last_pic_num= *picture_number;
- }else{
- int h_chroma_shift, v_chroma_shift;
-- int s_align, pixel_size;
-+ int s_align, pixel_size, size[3];
-+ AVPicture picture;
-
- avcodec_get_chroma_sub_sample(s->pix_fmt, &h_chroma_shift, &v_chroma_shift);
--
-- switch(s->pix_fmt){
-- case PIX_FMT_RGB555:
-- case PIX_FMT_RGB565:
-- case PIX_FMT_YUV422:
-- pixel_size=2;
-- break;
-- case PIX_FMT_RGB24:
-- case PIX_FMT_BGR24:
-- pixel_size=3;
-- break;
-- case PIX_FMT_RGBA32:
-- pixel_size=4;
-- break;
-- default:
-- pixel_size=1;
-- }
-
- avcodec_align_dimensions(s, &w, &h);
- #if defined(ARCH_POWERPC) || defined(HAVE_MMI) //FIXME some cleaner check
-@@ -243,20 +227,39 @@ int avcodec_default_get_buffer(AVCodecCo
- h+= EDGE_WIDTH*2;
- }
-
-+ avpicture_fill(&picture, NULL, s->pix_fmt, w, h);
-+ pixel_size= picture.linesize[0]*8 / w;
-+//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d\n", (int)picture.data[1], w, h, s->pix_fmt);
-+ assert(pixel_size>=1);
-+ //FIXME next ensures that linesize= 2^x uvlinesize, thats needed because some MC code assumes it
-+ if(pixel_size == 3*8)
-+ w= ALIGN(w, s_align<<h_chroma_shift);
-+ else
-+ w= ALIGN(pixel_size*w, s_align<<(h_chroma_shift+3)) / pixel_size;
-+ size[1] = avpicture_fill(&picture, NULL, s->pix_fmt, w, h);
-+ size[0] = picture.linesize[0] * h;
-+ size[1] -= size[0];
-+ if(picture.data[2])
-+ size[1]= size[2]= size[1]/2;
-+ else
-+ size[2]= 0;
-+
- buf->last_pic_num= -256*256*256*64;
-+ memset(buf->base, 0, sizeof(buf->base));
-+ memset(buf->data, 0, sizeof(buf->data));
-
-- for(i=0; i<3; i++){
-+ for(i=0; i<3 && size[i]; i++){
- const int h_shift= i==0 ? 0 : h_chroma_shift;
- const int v_shift= i==0 ? 0 : v_chroma_shift;
-
-- //FIXME next ensures that linesize= 2^x uvlinesize, thats needed because some MC code assumes it
-- buf->linesize[i]= ALIGN(pixel_size*w>>h_shift, s_align<<(h_chroma_shift-h_shift));
-+ buf->linesize[i]= picture.linesize[i];
-
-- buf->base[i]= av_mallocz((buf->linesize[i]*h>>v_shift)+16); //FIXME 16
-+ buf->base[i]= av_malloc(size[i]+16); //FIXME 16
- if(buf->base[i]==NULL) return -1;
-- memset(buf->base[i], 128, buf->linesize[i]*h>>v_shift);
--
-- if(s->flags&CODEC_FLAG_EMU_EDGE)
-+ memset(buf->base[i], 128, size[i]);
-+
-+ // no edge if EDEG EMU or not planar YUV, we check for PAL8 redundantly to protect against a exploitable bug regression ...
-+ if((s->flags&CODEC_FLAG_EMU_EDGE) || (s->pix_fmt == PIX_FMT_PAL8) || !size[2])
- buf->data[i] = buf->base[i];
- else
- buf->data[i] = buf->base[i] + ALIGN((buf->linesize[i]*EDGE_WIDTH>>v_shift) + (EDGE_WIDTH>>h_shift), s_align);
diff --git a/multimedia/ffmpeg/patches/patch-ag b/multimedia/ffmpeg/patches/patch-ag
deleted file mode 100644
index 7f88193950b..00000000000
--- a/multimedia/ffmpeg/patches/patch-ag
+++ /dev/null
@@ -1,194 +0,0 @@
-$NetBSD: patch-ag,v 1.2 2006/02/16 10:26:30 abs Exp $
-
---- libavformat/audio.c.orig 2004-06-19 05:59:34.000000000 +0200
-+++ libavformat/audio.c
-@@ -18,10 +18,19 @@
- */
- #include "avformat.h"
-
-+#ifdef __NetBSD__
-+#define USE_SUNAUDIO
-+#endif
-+
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
-+#ifndef USE_SUNAUDIO
- #include <sys/soundcard.h>
-+#else
-+#include <sys/types.h>
-+#include <sys/audioio.h>
-+#endif
- #include <unistd.h>
- #include <fcntl.h>
- #include <sys/ioctl.h>
-@@ -47,9 +56,18 @@ static int audio_open(AudioData *s, int
- int tmp, err;
- char *flip = getenv("AUDIO_FLIP_LEFT");
-
-+#ifdef USE_SUNAUDIO
-+ audio_info_t info;
-+ struct audio_prinfo *settings;
-+ int mixer_fd;
-+
-+ if (!audio_device)
-+ audio_device = "/dev/audio";
-+#else
- /* open linux audio device */
- if (!audio_device)
- audio_device = "/dev/dsp";
-+#endif
-
- if (is_output)
- audio_fd = open(audio_device, O_WRONLY);
-@@ -77,6 +95,7 @@ static int audio_open(AudioData *s, int
- }
- #endif
-
-+#ifndef USE_SUNAUDIO
- /* select format : favour native format */
- err = ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &tmp);
-
-@@ -124,14 +143,114 @@ static int audio_open(AudioData *s, int
- }
- if (tmp)
- s->channels = 2;
-+#else /* USE_SUNAUDIO */
-+ AUDIO_INITINFO(&info);
-+ if (!is_output) {
-+ info.mode = AUMODE_RECORD;
-+ settings = &info.record;
-+ } else {
-+ info.mode = AUMODE_PLAY;
-+ settings = &info.play;
-+ }
-+
-+ /* select format */
-+ /* Try native 16 bit format first */
-+#ifdef WORDS_BIGENDIAN
-+ settings->encoding = AUDIO_ENCODING_SLINEAR_BE;
-+ s->codec_id = CODEC_ID_PCM_S16BE;
-+#else
-+ settings->encoding = AUDIO_ENCODING_SLINEAR_LE;
-+ s->codec_id = CODEC_ID_PCM_S16LE;
-+#endif
-+ settings->precision = 16;
-+ err = ioctl(audio_fd, AUDIO_SETINFO, &info);
-+ if (err < 0) {
-+ fprintf(stderr, "Soundcard does not support signed 16 bit sample format\n");
-+ close(audio_fd);
-+ return -EIO;
-+ }
-
-+ /* set channels */
-+ AUDIO_INITINFO(&info);
-+ settings->channels = s->channels;
-+ err = ioctl(audio_fd, AUDIO_SETINFO, &info);
-+ if (err < 0) {
-+ fprintf(stderr, "stereo not supported, using mono");
-+ }
-+
-+ /* set gain */
-+ AUDIO_INITINFO(&info);
-+ settings->gain = AUDIO_MAX_GAIN;
-+ err = ioctl(audio_fd, AUDIO_SETINFO, &info);
-+ if (err < 0) {
-+ fprintf(stderr, "setting gain to %d failed", AUDIO_MAX_GAIN);
-+ }
-+
-+#ifndef MIXER_DEVICE
-+#define MIXER_DEVICE "/dev/mixer"
-+#endif
-+ if ((mixer_fd=open(MIXER_DEVICE, O_RDONLY)) == -1)
-+ fprintf(stderr, "can't open %s\n", MIXER_DEVICE);
-+ else {
-+ int n;
-+ mixer_devinfo_t mdt;
-+ /* get debuggin information about all mixer devices */
-+ mdt.index = n = 0;
-+ while (ioctl(mixer_fd, AUDIO_MIXER_DEVINFO, &mdt) != -1) {
-+ if (strcasecmp(mdt.label.name, "inputs") == 0) {
-+ while (mdt.next != -1) {
-+ printf("Mixer device %d: `%s' has type %d, class %d\n",
-+ mdt.index, mdt.label.name, mdt.type,
-+ mdt.mixer_class);
-+ mdt.index = mdt.next;
-+ if (ioctl(mixer_fd, AUDIO_MIXER_DEVINFO, &mdt) == -1) {
-+ fprintf(stderr, "getting next mixer device "
-+ "failed (%d)", mdt.index);
-+ break;
-+ }
-+ printf("next device: ");
-+ }
-+ printf("Mixer device %d: `%s' has type %d, class %d\n",
-+ mdt.index, mdt.label.name, mdt.type,
-+ mdt.mixer_class);
-+ }
-+ n++;
-+ mdt.index = n;
-+ }
-+ /* set input to line-in */
-+ AUDIO_INITINFO(&info);
-+ settings->port = AUDIO_LINE_IN;
-+ err = ioctl(audio_fd, AUDIO_SETINFO, &info);
-+ if (err < 0) {
-+ fprintf(stderr, "setting input to line-in failed");
-+ }
-+ }
-+ close(mixer_fd);
-+#endif
-+
-+#ifndef USE_SUNAUDIO
- tmp = s->sample_rate;
- err = ioctl(audio_fd, SNDCTL_DSP_SPEED, &tmp);
- if (err < 0) {
- perror("SNDCTL_DSP_SPEED");
- goto fail;
- }
-+
- s->sample_rate = tmp; /* store real sample rate */
-+#else
-+ AUDIO_INITINFO(&info);
-+ settings->sample_rate = s->sample_rate;
-+ err = ioctl(audio_fd, AUDIO_SETINFO, &info);
-+ if (err < 0) {
-+ fprintf(stderr, "setting sample rate to %d failed", s->sample_rate);
-+ err = ioctl(audio_fd, AUDIO_GETINFO, &info);
-+ if (err < 0) {
-+ perror("AUDIO_GETINFO");
-+ goto fail;
-+ }
-+ s->sample_rate = settings->sample_rate;
-+ }
-+#endif
- s->fd = audio_fd;
-
- return 0;
-@@ -240,7 +359,11 @@ static int audio_read_packet(AVFormatCon
- AudioData *s = s1->priv_data;
- int ret, bdelay;
- int64_t cur_time;
-+#ifndef USE_SUNAUDIO
- struct audio_buf_info abufi;
-+#else
-+ audio_info_t info;
-+#endif
-
- if (av_new_packet(pkt, s->frame_size) < 0)
- return AVERROR_IO;
-@@ -276,9 +399,15 @@ static int audio_read_packet(AVFormatCon
- /* compute pts of the start of the packet */
- cur_time = av_gettime();
- bdelay = ret;
-+#ifndef USE_SUNAUDIO
- if (ioctl(s->fd, SNDCTL_DSP_GETISPACE, &abufi) == 0) {
- bdelay += abufi.bytes;
- }
-+#else
-+ if (ioctl(s->fd, AUDIO_GETINFO, &info) == 0) {
-+ bdelay += info.record.seek * (info.record.precision/8);
-+ }
-+#endif
- /* substract time represented by the number of bytes in the audio fifo */
- cur_time -= (bdelay * 1000000LL) / (s->sample_rate * s->channels);
-
diff --git a/multimedia/ffmpeg/patches/patch-ah b/multimedia/ffmpeg/patches/patch-ah
deleted file mode 100644
index d97fe5fc190..00000000000
--- a/multimedia/ffmpeg/patches/patch-ah
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-ah,v 1.1 2006/06/26 19:40:06 wiz Exp $
-
---- libavcodec/avcodec.h.orig 2004-07-09 12:49:55.000000000 +0000
-+++ libavcodec/avcodec.h
-@@ -1657,6 +1657,13 @@ typedef struct AVOption {
- #define FF_OPT_MAX_DEPTH 10
- } AVOption;
-
-+#ifdef HAVE_MMX
-+extern const struct AVOption avoptions_common[3 + 5];
-+#else
-+extern const struct AVOption avoptions_common[3];
-+#endif
-+extern const struct AVOption avoptions_workaround_bug[11];
-+
- /**
- * Parse option(s) and sets fields in passed structure
- * @param strct structure where the parsed results will be written
diff --git a/multimedia/ffmpeg/patches/patch-ai b/multimedia/ffmpeg/patches/patch-ai
deleted file mode 100644
index 421732c4ccd..00000000000
--- a/multimedia/ffmpeg/patches/patch-ai
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-ai,v 1.1 2006/06/26 19:40:06 wiz Exp $
-
---- libavcodec/common.h.orig 2004-07-01 12:33:07.000000000 +0000
-+++ libavcodec/common.h
-@@ -62,14 +62,6 @@
- #define AVOPTION_SUB(ptr) { .name = NULL, .help = (const char*)ptr }
- #define AVOPTION_END() AVOPTION_SUB(NULL)
-
--struct AVOption;
--#ifdef HAVE_MMX
--extern const struct AVOption avoptions_common[3 + 5];
--#else
--extern const struct AVOption avoptions_common[3];
--#endif
--extern const struct AVOption avoptions_workaround_bug[11];
--
- #endif /* HAVE_AV_CONFIG_H */
-
- /* Suppress restrict if it was not defined in config.h. */
diff --git a/multimedia/ffmpeg/patches/patch-aj b/multimedia/ffmpeg/patches/patch-aj
deleted file mode 100644
index 965519892e9..00000000000
--- a/multimedia/ffmpeg/patches/patch-aj
+++ /dev/null
@@ -1,60 +0,0 @@
-$NetBSD: patch-aj,v 1.1 2006/06/26 19:40:06 wiz Exp $
-
---- libavcodec/ac3tab.h.orig 2004-06-26 10:08:49.000000000 +0000
-+++ libavcodec/ac3tab.h
-@@ -4,10 +4,10 @@
- */
-
- /* possible frequencies */
--static const uint16_t ac3_freqs[3] = { 48000, 44100, 32000 };
-+const uint16_t ac3_freqs[3] = { 48000, 44100, 32000 };
-
- /* possible bitrates */
--static const uint16_t ac3_bitratetab[19] = {
-+const uint16_t ac3_bitratetab[19] = {
- 32, 40, 48, 56, 64, 80, 96, 112, 128,
- 160, 192, 224, 256, 320, 384, 448, 512, 576, 640
- };
-@@ -15,7 +15,7 @@ static const uint16_t ac3_bitratetab[19]
- /* AC3 MDCT window */
-
- /* MDCT window */
--static const int16_t ac3_window[256] = {
-+const int16_t ac3_window[256] = {
- 4, 7, 12, 16, 21, 28, 34, 42,
- 51, 61, 72, 84, 97, 111, 127, 145,
- 164, 184, 207, 231, 257, 285, 315, 347,
-@@ -144,27 +144,27 @@ static const uint8_t baptab[64]= {
- 15, 15, 15, 15,
- };
-
--static const uint8_t sdecaytab[4]={
-+const uint8_t sdecaytab[4]={
- 0x0f, 0x11, 0x13, 0x15,
- };
-
--static const uint8_t fdecaytab[4]={
-+const uint8_t fdecaytab[4]={
- 0x3f, 0x53, 0x67, 0x7b,
- };
-
--static const uint16_t sgaintab[4]= {
-+const uint16_t sgaintab[4]= {
- 0x540, 0x4d8, 0x478, 0x410,
- };
-
--static const uint16_t dbkneetab[4]= {
-+const uint16_t dbkneetab[4]= {
- 0x000, 0x700, 0x900, 0xb00,
- };
-
--static const uint16_t floortab[8]= {
-+const uint16_t floortab[8]= {
- 0x2f0, 0x2b0, 0x270, 0x230, 0x1f0, 0x170, 0x0f0, 0xf800,
- };
-
--static const uint16_t fgaintab[8]= {
-+const uint16_t fgaintab[8]= {
- 0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380, 0x400,
- };
-
diff --git a/multimedia/ffmpeg/patches/patch-ak b/multimedia/ffmpeg/patches/patch-ak
deleted file mode 100644
index c73046a2147..00000000000
--- a/multimedia/ffmpeg/patches/patch-ak
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-ak,v 1.1 2007/08/02 21:48:34 dbj Exp $
-
---- libavcodec/msmpeg4.c.orig 2004-05-25 11:07:24.000000000 -0700
-+++ libavcodec/msmpeg4.c 2007-08-02 11:27:58.000000000 -0700
-@@ -716,7 +716,11 @@ static inline int msmpeg4_pred_dc(MpegEn
- necessitate to modify mpegvideo.c. The problem comes from the
- fact they decided to store the quantized DC (which would lead
- to problems if Q could vary !) */
--#if defined ARCH_X86 && !defined PIC
-+/* XXX
-+ * i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
-+ * error: can't find a register in class ?BREG? while reloading ?asm?
-+ */
-+#if defined ARCH_X86 && !defined PIC && !defined __APPLE__
- asm volatile(
- "movl %3, %%eax \n\t"
- "shrl $1, %%eax \n\t"
diff --git a/multimedia/ffmpeg/patches/patch-al b/multimedia/ffmpeg/patches/patch-al
deleted file mode 100644
index 63e2a8ceeff..00000000000
--- a/multimedia/ffmpeg/patches/patch-al
+++ /dev/null
@@ -1,52 +0,0 @@
-$NetBSD: patch-al,v 1.1 2008/09/01 00:00:10 tonnerre Exp $
-
---- libavformat/psxstr.c.orig 2004-06-19 05:59:34.000000000 +0200
-+++ libavformat/psxstr.c
-@@ -273,12 +273,21 @@ static int str_read_packet(AVFormatConte
- int current_sector = LE_16(&sector[0x1C]);
- int sector_count = LE_16(&sector[0x1E]);
- int frame_size = LE_32(&sector[0x24]);
-- int bytes_to_copy;
-+
-+ if(!( frame_size>=0
-+ && current_sector < sector_count
-+ && sector_count*VIDEO_DATA_CHUNK_SIZE >=frame_size)){
-+ av_log(s, AV_LOG_ERROR, "Invalid parameters %d %d %d\n", current_sector, sector_count, frame_size);
-+ return AVERROR_INVALIDDATA;
-+ }
- // printf("%d %d %d\n",current_sector,sector_count,frame_size);
- /* if this is the first sector of the frame, allocate a pkt */
- pkt = &str->tmp_pkt;
-- if (current_sector == 0) {
-- if (av_new_packet(pkt, frame_size))
-+ if (pkt->size != sector_count*VIDEO_DATA_CHUNK_SIZE){
-+ if(pkt->data)
-+ av_log(s, AV_LOG_ERROR, "missmatching sector_count\n");
-+ av_free_packet(pkt);
-+ if (av_new_packet(pkt, sector_count*VIDEO_DATA_CHUNK_SIZE))
- return AVERROR_IO;
-
- pkt->stream_index =
-@@ -291,15 +300,15 @@ static int str_read_packet(AVFormatConte
- str->pts += (90000 / 15);
- }
-
-- /* load all the constituent chunks in the video packet */
-- bytes_to_copy = frame_size - current_sector*VIDEO_DATA_CHUNK_SIZE;
-- if (bytes_to_copy>0) {
-- if (bytes_to_copy>VIDEO_DATA_CHUNK_SIZE) bytes_to_copy=VIDEO_DATA_CHUNK_SIZE;
-- memcpy(pkt->data + current_sector*VIDEO_DATA_CHUNK_SIZE,
-- sector + VIDEO_DATA_HEADER_SIZE, bytes_to_copy);
-- }
-+ memcpy(pkt->data + current_sector*VIDEO_DATA_CHUNK_SIZE,
-+ sector + VIDEO_DATA_HEADER_SIZE,
-+ VIDEO_DATA_CHUNK_SIZE);
-+
- if (current_sector == sector_count-1) {
-+ pkt->size= frame_size;
- *ret_pkt = *pkt;
-+ pkt->data= NULL;
-+ pkt->size= -1;
- return 0;
- }
-
diff --git a/multimedia/ffmpeg/patches/patch-an b/multimedia/ffmpeg/patches/patch-an
deleted file mode 100644
index 9504783a636..00000000000
--- a/multimedia/ffmpeg/patches/patch-an
+++ /dev/null
@@ -1,21 +0,0 @@
-$NetBSD: patch-an,v 1.1 2007/08/02 21:48:34 dbj Exp $
-
---- libavcodec/liba52/resample.c.orig 2003-11-03 10:06:54.000000000 -0800
-+++ libavcodec/liba52/resample.c 2007-08-02 12:37:36.000000000 -0700
-@@ -13,14 +13,14 @@ int (* a52_resample) (float * _f, int16_
-
- #include "resample_c.c"
-
--#ifdef ARCH_X86
-+#ifdef HAVE_MMX
- #include "resample_mmx.c"
- #endif
-
- void* a52_resample_init(uint32_t mm_accel,int flags,int chans){
- void* tmp;
-
--#ifdef ARCH_X86
-+#ifdef HAVE_MMX
- if(mm_accel&MM_ACCEL_X86_MMX){
- tmp=a52_resample_MMX(flags,chans);
- if(tmp){
diff --git a/multimedia/ffmpeg/patches/patch-ao b/multimedia/ffmpeg/patches/patch-ao
deleted file mode 100644
index 8fb3251613c..00000000000
--- a/multimedia/ffmpeg/patches/patch-ao
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ao,v 1.1 2007/08/02 21:48:34 dbj Exp $
-
---- libavformat/tcp.c.orig 2004-06-18 20:59:34.000000000 -0700
-+++ libavformat/tcp.c 2007-08-02 12:51:07.000000000 -0700
-@@ -21,7 +21,7 @@
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
--#if defined(__APPLE__) || defined(__BEOS__)
-+#if defined(__BEOS__)
- typedef int socklen_t;
- #endif
- #ifndef __BEOS__
diff --git a/multimedia/ffmpeg/patches/patch-bktr b/multimedia/ffmpeg/patches/patch-bktr
new file mode 100644
index 00000000000..0a2fdcc8c92
--- /dev/null
+++ b/multimedia/ffmpeg/patches/patch-bktr
@@ -0,0 +1,13 @@
+$NetBSD: patch-bktr,v 1.1 2008/09/07 23:39:38 ahoka Exp $
+
+--- libavdevice/bktr.c.orig 2008-06-03 18:20:54.000000000 +0200
++++ libavdevice/bktr.c
+@@ -31,7 +31,7 @@
+ #elif defined (HAVE_MACHINE_IOCTL_METEOR_H) && defined (HAVE_MACHINE_IOCTL_BT848_H)
+ # include <machine/ioctl_meteor.h>
+ # include <machine/ioctl_bt848.h>
+-#elif defined (HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H) && defined (HAVE_DEV_VIDEO_METEOR_IOCTL_BT848_H)
++#elif defined (HAVE_DEV_VIDEO_METEOR_IOCTL_METEOR_H) && defined (HAVE_DEV_VIDEO_BKTR_IOCTL_BT848_H)
+ # include <dev/video/meteor/ioctl_meteor.h>
+ # include <dev/video/bktr/ioctl_bt848.h>
+ #elif HAVE_DEV_IC_BT8XX_H
diff --git a/multimedia/ffmpeg/patches/patch-configure b/multimedia/ffmpeg/patches/patch-configure
new file mode 100644
index 00000000000..aad8233a5df
--- /dev/null
+++ b/multimedia/ffmpeg/patches/patch-configure
@@ -0,0 +1,21 @@
+$NetBSD: patch-configure,v 1.1 2008/09/07 23:39:38 ahoka Exp $
+
+--- configure.orig 2008-07-24 12:53:32.000000000 +0200
++++ configure
+@@ -891,7 +891,7 @@ rtp_muxer_deps="network rtp_protocol"
+ rtsp_demuxer_deps="sdp_demuxer"
+ sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
+ v4l_demuxer_deps="linux_videodev_h"
+-v4l2_demuxer_deps="linux_videodev2_h"
++v4l2_demuxer_deps_any="linux_videodev2_h sys_videoio_h"
+ vfwcap_demuxer_deps="capCreateCaptureWindow"
+ vfwcap_demuxer_extralibs="-lvfw32"
+ x11_grab_device_demuxer_deps="x11grab XShmCreateImage"
+@@ -1789,6 +1789,7 @@ EOF
+
+ check_header linux/videodev.h
+ check_header linux/videodev2.h
++check_header sys/videoio.h
+
+ check_func2 "windows.h vfw.h" capCreateCaptureWindow -lvfw32
+
diff --git a/multimedia/ffmpeg/patches/patch-r14477 b/multimedia/ffmpeg/patches/patch-r14477
new file mode 100644
index 00000000000..60d3af07294
--- /dev/null
+++ b/multimedia/ffmpeg/patches/patch-r14477
@@ -0,0 +1,16 @@
+$NetBSD: patch-r14477,v 1.1 2008/09/07 23:39:38 ahoka Exp $
+
+From ffmpeg svn. Remove after upgrading the ffmpeg.
+
+--- libavformat/avidec.c 2008/07/04 13:05:06 14064
++++ libavformat/avidec.c 2008/07/30 21:07:54 14477
+@@ -1026,8 +1026,7 @@
+ continue;
+
+ // assert(st2->codec->block_align);
+- assert(st2->time_base.den == ast2->rate);
+- assert(st2->time_base.num == ast2->scale);
++ assert((int64_t)st2->time_base.num*ast2->rate == (int64_t)st2->time_base.den*ast2->scale);
+ index = av_index_search_timestamp(
+ st2,
+ av_rescale(timestamp, st2->time_base.den*(int64_t)st->time_base.num, st->time_base.den * (int64_t)st2->time_base.num),
diff --git a/multimedia/ffmpeg/patches/patch-v4l2 b/multimedia/ffmpeg/patches/patch-v4l2
new file mode 100644
index 00000000000..b7a6ef3aade
--- /dev/null
+++ b/multimedia/ffmpeg/patches/patch-v4l2
@@ -0,0 +1,20 @@
+$NetBSD: patch-v4l2,v 1.1 2008/09/07 23:39:38 ahoka Exp $
+
+--- libavdevice/v4l2.c.orig 2008-07-15 22:45:42.000000000 +0200
++++ libavdevice/v4l2.c
+@@ -34,8 +34,13 @@
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
+ #include <sys/time.h>
+-#include <asm/types.h>
+-#include <linux/videodev2.h>
++#if defined(__NetBSD__) || defined(__OpenBSD__)
++# include <sys/types.h>
++# include <sys/videoio.h>
++#else
++# include <asm/types.h>
++# include <linux/videodev2.h>
++#endif
+ #include <time.h>
+
+ static const int desired_video_buffers = 256;