From e9251bb5555f6daa6be10437f97579d85d6fdc89 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Sun, 24 Apr 2011 11:39:15 +0200 Subject: [PATCH 1/6] configure: Add missing libavutil inter-library dependencies to .pc files. This unbreaks static compilation when using pkg-config. Based on an mplayer2 patch by Uoti Urpala Signed-off-by: Diego Biurrun --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index c01c551cf5..6dd00dc161 100755 --- a/configure +++ b/configure @@ -3428,9 +3428,9 @@ EOF } pkgconfig_generate libavutil "Libav utility library" "$LIBAVUTIL_VERSION" -pkgconfig_generate libavcodec "Libav codec library" "$LIBAVCODEC_VERSION" "$extralibs" +pkgconfig_generate libavcodec "Libav codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION" pkgconfig_generate libavformat "Libav container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION" pkgconfig_generate libavdevice "Libav device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION" pkgconfig_generate libavfilter "Libav video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" -pkgconfig_generate libpostproc "Libav post processing library" "$LIBPOSTPROC_VERSION" +pkgconfig_generate libpostproc "Libav post processing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION" pkgconfig_generate libswscale "Libav image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION" From dc713546d4ffcd2fbc8e0ecd28fbcf6cd252061a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Sun, 24 Apr 2011 15:40:57 +0200 Subject: [PATCH 2/6] oggdec: reindent after 8f3eebd6 Signed-off-by: Diego Biurrun --- libavformat/oggdec.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index d2725792e9..8d96320b3f 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -242,14 +242,14 @@ ogg_read_page (AVFormatContext * s, int *str) idx = ogg_find_stream (ogg, serial); if (idx < 0){ if (ogg->headers) { - int n; + int n; - for (n = 0; n < ogg->nstreams; n++) { - av_freep(&ogg->streams[n].buf); - av_freep(&ogg->streams[n].private); - } - ogg->curidx = -1; - ogg->nstreams = 0; + for (n = 0; n < ogg->nstreams; n++) { + av_freep(&ogg->streams[n].buf); + av_freep(&ogg->streams[n].private); + } + ogg->curidx = -1; + ogg->nstreams = 0; } idx = ogg_new_stream (s, serial); if (idx < 0) From 50f7c296469e9675e07fd1afa37b5e430b876f1c Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Sun, 24 Apr 2011 17:24:24 +0200 Subject: [PATCH 3/6] configure: Add missing libm library dependencies to .pc files. This unbreaks static compilation using pkg-config on systems in need of -lm. Based on an mplayer2 patch by Uoti Urpala Signed-off-by: Diego Biurrun --- configure | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 6dd00dc161..f514503785 100755 --- a/configure +++ b/configure @@ -2840,7 +2840,7 @@ for thread in $THREADS_LIST; do fi done -check_lib math.h sin -lm +check_lib math.h sin -lm && LIBM="-lm" enabled vaapi && require vaapi va/va.h vaInitialize -lva check_mathfunc exp2 @@ -3427,10 +3427,10 @@ Cflags: -I\${includedir} EOF } -pkgconfig_generate libavutil "Libav utility library" "$LIBAVUTIL_VERSION" -pkgconfig_generate libavcodec "Libav codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION" +pkgconfig_generate libavutil "Libav utility library" "$LIBAVUTIL_VERSION" "$LIBM" +pkgconfig_generate libavcodec "Libav codec library" "$LIBAVCODEC_VERSION" "$extralibs $LIBM" "libavutil = $LIBAVUTIL_VERSION" pkgconfig_generate libavformat "Libav container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION" pkgconfig_generate libavdevice "Libav device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION" pkgconfig_generate libavfilter "Libav video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" pkgconfig_generate libpostproc "Libav post processing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION" -pkgconfig_generate libswscale "Libav image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION" +pkgconfig_generate libswscale "Libav image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION" From ac9cf2e5c48aa1edb2c7ba8e7edfa55c9fde609b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sun, 24 Apr 2011 20:10:37 +0300 Subject: [PATCH 4/6] crypto: Use av_freep instead of av_free MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using av_freep is generally good practice. Signed-off-by: Martin Storsjö --- libavformat/crypto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/crypto.c b/libavformat/crypto.c index ea6012ad09..fecc2c961c 100644 --- a/libavformat/crypto.c +++ b/libavformat/crypto.c @@ -153,9 +153,9 @@ static int crypto_close(URLContext *h) CryptoContext *c = h->priv_data; if (c->hd) ffurl_close(c->hd); - av_free(c->aes); - av_free(c->key); - av_free(c->iv); + av_freep(&c->aes); + av_freep(&c->key); + av_freep(&c->iv); return 0; } From 5f85d49b6889b9a2ecd18695fe52c5c9b698a0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sun, 24 Apr 2011 20:19:49 +0300 Subject: [PATCH 5/6] applehttp: Don't export variant_bitrate if it isn't known MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If there are no variants, the total bitrate of the single stream isn't known, and exporting variant_bitrate = 0 does look weird, since there really aren't any variants. Signed-off-by: Martin Storsjö --- libavformat/applehttp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c index 2e0e8a1b3a..822d80bb00 100644 --- a/libavformat/applehttp.c +++ b/libavformat/applehttp.c @@ -505,7 +505,9 @@ static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap) goto fail; } avcodec_copy_context(st->codec, v->ctx->streams[j]->codec); - av_metadata_set2(&st->metadata, "variant_bitrate", bitrate_str, 0); + if (v->bandwidth) + av_metadata_set2(&st->metadata, "variant_bitrate", bitrate_str, + 0); } stream_offset += v->ctx->nb_streams; } From 2441003d3fdc01545690c2f397efd7acfd876d6c Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 24 Apr 2011 19:49:39 +0200 Subject: [PATCH 6/6] vorbisdec: Employ proper printf format specifiers for uint_fast32_t. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libavcodec/vorbisdec.c:543: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘uint_fast32_t’ libavcodec/vorbisdec.c:543: warning: format ‘%d’ expects type ‘int’, but argument 5 has type ‘uint_fast32_t’ --- libavcodec/vorbisdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index 5fa7be1365..d42507df84 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -539,7 +539,7 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) rangemax = (1 << rangebits); if (rangemax > vc->blocksize[1] / 2) { av_log(vc->avccontext, AV_LOG_ERROR, - "Floor value is too large for blocksize: %d (%d)\n", + "Floor value is too large for blocksize: %"PRIuFAST32" (%"PRIuFAST32")\n", rangemax, vc->blocksize[1] / 2); return -1; }