From 7f01a4192cdf4565eadee457f76e6b5196e35e0b Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Wed, 29 Jun 2011 13:41:47 -0700 Subject: [PATCH 1/7] adts: Fix PCE copying. Parse the extension flag bit when reading the MPEG4 AudioSpecificConfig. This has nothing to do with SBR/PS contradictory to what was noted when it was removed. --- libavformat/adtsenc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c index e858a81d92..75649e24dc 100644 --- a/libavformat/adtsenc.c +++ b/libavformat/adtsenc.c @@ -59,6 +59,10 @@ int ff_adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t *buf av_log(s, AV_LOG_ERROR, "Scalable configurations are not allowed in ADTS\n"); return -1; } + if (get_bits(&gb, 1)) { + av_log(s, AV_LOG_ERROR, "Extension flag is not allowed in ADTS\n"); + return -1; + } if (!adts->channel_conf) { init_put_bits(&pb, adts->pce_data, MAX_PCE_SIZE); From b0058bda78bcbb6a887e5099b85ac3bc2e23bb57 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Thu, 7 Jul 2011 01:31:00 +0200 Subject: [PATCH 2/7] libvo-amrwbenc: Add braces to shut up gcc warning. libavcodec/libvo-amrwbenc.c:37:5: warning: missing braces around initializer --- libavcodec/libvo-amrwbenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libvo-amrwbenc.c b/libavcodec/libvo-amrwbenc.c index b3615ede42..201a74ed26 100644 --- a/libavcodec/libvo-amrwbenc.c +++ b/libavcodec/libvo-amrwbenc.c @@ -34,7 +34,7 @@ typedef struct AMRWBContext { } AMRWBContext; static const AVOption options[] = { - { "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRWBContext, allow_dtx), FF_OPT_TYPE_INT, 0, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM }, + { "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRWBContext, allow_dtx), FF_OPT_TYPE_INT, { 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM }, { NULL } }; From 9d36139231bfcf155a1b94f61a420768f1771174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 7 Jul 2011 09:50:43 +0300 Subject: [PATCH 3/7] docs: Don't recommend adding --enable-memalign-hack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is enabled automatically when required nowadays. Signed-off-by: Martin Storsjö --- doc/general.texi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/general.texi b/doc/general.texi index 775bf5d03f..6e21ca899e 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -949,7 +949,7 @@ MSVC++-compatible import libraries. @item Build Libav with @example -./configure --enable-shared --enable-memalign-hack +./configure --enable-shared make make install @end example @@ -1071,12 +1071,12 @@ and add some special flags to your configure invocation. For a static build run @example -./configure --target-os=mingw32 --enable-memalign-hack --enable-static --disable-shared --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin +./configure --target-os=mingw32 --enable-static --disable-shared --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin @end example and for a build with shared libraries @example -./configure --target-os=mingw32 --enable-memalign-hack --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin +./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin @end example @bye From 6e4ca0749c2e6434e071dbd314076613fb3ef59b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 7 Jul 2011 09:51:57 +0300 Subject: [PATCH 4/7] docs: Remove needless configure options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Specifying --enable-static --disable-shared isn't necessary, these are the defaults. Signed-off-by: Martin Storsjö --- doc/general.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/general.texi b/doc/general.texi index 6e21ca899e..93f563e1bf 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -1024,7 +1024,7 @@ diffutils Then run @example -./configure --enable-static --disable-shared +./configure @end example to make a static build. @@ -1071,7 +1071,7 @@ and add some special flags to your configure invocation. For a static build run @example -./configure --target-os=mingw32 --enable-static --disable-shared --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin +./configure --target-os=mingw32 --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin @end example and for a build with shared libraries From 357d0d8fc787ea5d6ca8ba0839f94493604208a3 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Thu, 7 Jul 2011 01:31:01 +0200 Subject: [PATCH 5/7] libgsm: Drop const qualifier to silence compiler warning. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libavcodec/libgsm.c:148: warning: passing argument 2 of ‘gsm_decode’ discards qualifiers from pointer target type /usr/include/gsm/gsm.h:68: note: expected ‘gsm_byte *’ but argument is of type ‘const uint8_t *’ --- libavcodec/libgsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c index 34f29573db..0573cb33d6 100644 --- a/libavcodec/libgsm.c +++ b/libavcodec/libgsm.c @@ -139,7 +139,7 @@ AVCodec ff_libgsm_ms_encoder = { static int libgsm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { - const uint8_t *buf = avpkt->data; + uint8_t *buf = avpkt->data; int buf_size = avpkt->size; *data_size = 0; /* In case of error */ if(buf_size < avctx->block_align) return -1; From 965fdda0159a5ce22a16d41f3cb197c5ab6651f0 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Thu, 7 Jul 2011 01:31:05 +0200 Subject: [PATCH 6/7] vf_drawtext: Remove some write-only variables. libavfilter/vf_drawtext.c:427:22: warning: variable 'dst_pixel' set but not used libavfilter/vf_drawtext.c:463:22: warning: variable 'dst_pixel' set but not used --- libavfilter/vf_drawtext.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c index a3adaa7dfc..ed4b1003d8 100644 --- a/libavfilter/vf_drawtext.c +++ b/libavfilter/vf_drawtext.c @@ -424,15 +424,10 @@ static inline int draw_glyph_yuv(AVFilterBufferRef *picref, FT_Bitmap *bitmap, u { int r, c, alpha; unsigned int luma_pos, chroma_pos1, chroma_pos2; - uint8_t src_val, dst_pixel[4]; + uint8_t src_val; for (r = 0; r < bitmap->rows && r+y < height; r++) { for (c = 0; c < bitmap->width && c+x < width; c++) { - /* get pixel in the picref (destination) */ - dst_pixel[0] = picref->data[0][ c+x + (y+r) * picref->linesize[0]]; - dst_pixel[1] = picref->data[1][((c+x) >> hsub) + ((y+r) >> vsub) * picref->linesize[1]]; - dst_pixel[2] = picref->data[2][((c+x) >> hsub) + ((y+r) >> vsub) * picref->linesize[2]]; - /* get intensity value in the glyph bitmap (source) */ src_val = GET_BITMAP_VAL(r, c); if (!src_val) @@ -460,18 +455,10 @@ static inline int draw_glyph_rgb(AVFilterBufferRef *picref, FT_Bitmap *bitmap, { int r, c, alpha; uint8_t *p; - uint8_t src_val, dst_pixel[4]; + uint8_t src_val; for (r = 0; r < bitmap->rows && r+y < height; r++) { for (c = 0; c < bitmap->width && c+x < width; c++) { - /* get pixel in the picref (destination) */ - dst_pixel[0] = picref->data[0][(c+x + rgba_map[0]) * pixel_step + - (y+r) * picref->linesize[0]]; - dst_pixel[1] = picref->data[0][(c+x + rgba_map[1]) * pixel_step + - (y+r) * picref->linesize[0]]; - dst_pixel[2] = picref->data[0][(c+x + rgba_map[2]) * pixel_step + - (y+r) * picref->linesize[0]]; - /* get intensity value in the glyph bitmap (source) */ src_val = GET_BITMAP_VAL(r, c); if (!src_val) From 2f138f0b7c36fe50b51e0d74bc913d14aea00c5e Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Thu, 7 Jul 2011 15:25:30 +0100 Subject: [PATCH 7/7] build: clean up library installation rules Signed-off-by: Mans Rullgard --- configure | 22 ++++++++++++---------- subdir.mak | 14 +++++++------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/configure b/configure index e77340f74a..f5b4a5c767 100755 --- a/configure +++ b/configure @@ -1657,6 +1657,8 @@ SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)' SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)' SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)' LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"' +SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)' +SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)' AS_O='-o $@' CC_O='-o $@' @@ -2419,12 +2421,11 @@ case $target_os in SLIBSUF=".dll" SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' - SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)' - SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \ - install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"; \ - install -d "$(LIBDIR)"; \ - install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"' - SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"' + SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)' + SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)' + SLIB_INSTALL_LINKS= + SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)' + SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)' SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base' objformat="win32" dlltool="${cross_prefix}dlltool" @@ -2482,8 +2483,7 @@ case $target_os in emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def' SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \ emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;' - SLIB_INSTALL_EXTRA_CMD='install -m 644 $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"' - SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib' + SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib' enable dos_paths ;; gnu/kfreebsd) @@ -3242,8 +3242,10 @@ SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION} SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR} SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD} SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD} -SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD} -SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD} +SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME} +SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS} +SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB} +SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB} SAMPLES:=${samples:-\$(FATE_SAMPLES)} EOF diff --git a/subdir.mak b/subdir.mak index e7c9eaafca..3a38dafe63 100644 --- a/subdir.mak +++ b/subdir.mak @@ -56,12 +56,11 @@ distclean:: clean install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME) $(Q)mkdir -p "$(SHLIBDIR)" - $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)" - $(Q)cd "$(SHLIBDIR)" && \ - $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR) - $(Q)cd "$(SHLIBDIR)" && \ - $(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME) - $(SLIB_INSTALL_EXTRA_CMD) + $$(INSTALL) -m 755 $$< "$(SHLIBDIR)/$(SLIB_INSTALL_NAME)" + $(Q)$(foreach F,$(SLIB_INSTALL_LINKS),cd "$(SHLIBDIR)" && $(LN_S) $(SLIB_INSTALL_NAME) $(F);) + $(if $(SLIB_INSTALL_EXTRA_SHLIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_SHLIB:%=$(SUBDIR)%) "$(SHLIBDIR)") + $(if $(SLIB_INSTALL_EXTRA_LIB),$(Q)mkdir -p "$(LIBDIR)") + $(if $(SLIB_INSTALL_EXTRA_LIB),$$(INSTALL) -m 644 $(SLIB_INSTALL_EXTRA_LIB:%=$(SUBDIR)%) "$(LIBDIR)") install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME) $(Q)mkdir -p "$(LIBDIR)" @@ -80,7 +79,8 @@ uninstall-libs:: -$(RM) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR)" \ "$(SHLIBDIR)/$(SLIBNAME)" \ "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)" - -$(SLIB_UNINSTALL_EXTRA_CMD) + -$(RM) $(SLIB_INSTALL_EXTRA_SHLIB:%="$(SHLIBDIR)"%) + -$(RM) $(SLIB_INSTALL_EXTRA_LIB:%="$(LIBDIR)"%) -$(RM) "$(LIBDIR)/$(LIBNAME)" uninstall-headers::