From dcebb6f35d810c9009a455808b016c790bb633b4 Mon Sep 17 00:00:00 2001 From: Doug McMahon Date: Sun, 21 Dec 2014 22:25:28 -0500 Subject: [PATCH] Imported Debian version 2.5.1~trusty --- debian/changelog | 6 ++ ffmpeg/Changelog | 18 ++++- ffmpeg/MAINTAINERS | 1 + ffmpeg/RELEASE | 2 +- ffmpeg/RELEASE_NOTES | 18 ++--- ffmpeg/VERSION | 2 +- ffmpeg/configure | 2 +- ffmpeg/doc/Doxyfile | 2 +- ffmpeg/doc/examples/filtering_video.c | 3 +- ffmpeg/doc/examples/transcoding.c | 4 ++ ffmpeg/libavcodec/mpegaudiodec_template.c | 2 + ffmpeg/libavcodec/ppc/vc1dsp_altivec.c | 13 +++- ffmpeg/libavcodec/ppc/vp3dsp_altivec.c | 18 ++++- ffmpeg/libavcodec/ppc/vp8dsp_altivec.c | 86 +++++++++++++---------- ffmpeg/libavformat/aviobuf.c | 3 + ffmpeg/libavformat/crypto.c | 4 +- ffmpeg/libavformat/flvdec.c | 6 +- ffmpeg/libavformat/matroskadec.c | 6 +- ffmpeg/libavformat/utils.c | 2 + ffmpeg/libavutil/frame.c | 1 + ffmpeg/libswresample/soxr_resample.c | 8 ++- 21 files changed, 143 insertions(+), 64 deletions(-) diff --git a/debian/changelog b/debian/changelog index b0cadb8..4b57ce1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ffmpeg (7:2.5.1~trusty) trusty; urgency=medium + + * New point release + + -- Doug McMahon Sun, 21 Dec 2014 22:25:28 -0500 + ffmpeg (7:2.5.0~trusty1.1) trusty; urgency=medium * Enable libvo-aacenc in odd chance it's used diff --git a/ffmpeg/Changelog b/ffmpeg/Changelog index 0130ca8..ea7774d 100644 --- a/ffmpeg/Changelog +++ b/ffmpeg/Changelog @@ -1,6 +1,22 @@ Entries are sorted chronologically from oldest to youngest within each release, releases are sorted from youngest to oldest. +version 2.5.1: +- lavu/frame: fix malloc error path in av_frame_copy_props() +- avformat/aviobuf: Check that avio_seek() target is non negative +- swresample/soxr_resample: fix error handling +- avformat/flvdec: fix potential use of uninitialized variables +- avformat/crypto: fix key vs iv typo +- configure: use use_pkg_config() instead of check_pkg_config() for libsmbclient +- avcodec/ppc/vp3dsp_altivec: POWER LE support to vp3_idct_add_altivec() +- avformat/matroskadec: fix handling of recursive SeekHead elements +- doc/examples/filtering_video: fix frame rate +- avcodec/mpegaudiodec_template: only allocate fdsp when its used +- doc/examples/transcoding: check encoder before using it +- update MAINTAINERS file +- POWER LE support in put_vp8_epel_h_altivec_core() put_vp8_epel_v_altivec_core() put_vp8_pixels16_altivec() +- POWER LE support in vc1_inv_trans_8x4_altivec() + version 2.5: - HEVC/H.265 RTP payload format (draft v6) packetizer - SUP/PGS subtitle demuxer @@ -16,7 +32,7 @@ version 2.5: - creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer - WebP muxer with animated WebP support - zygoaudio decoding support -- APNG demuxer +- APNG decoder and demuxer - postproc visualization support diff --git a/ffmpeg/MAINTAINERS b/ffmpeg/MAINTAINERS index 15b976f..0f2faed 100644 --- a/ffmpeg/MAINTAINERS +++ b/ffmpeg/MAINTAINERS @@ -537,6 +537,7 @@ x86 Michael Niedermayer Releases ======== +2.5 Michael Niedermayer 2.4 Michael Niedermayer 2.2 Michael Niedermayer 1.2 Michael Niedermayer diff --git a/ffmpeg/RELEASE b/ffmpeg/RELEASE index 95e3ba8..73462a5 100644 --- a/ffmpeg/RELEASE +++ b/ffmpeg/RELEASE @@ -1 +1 @@ -2.5 +2.5.1 diff --git a/ffmpeg/RELEASE_NOTES b/ffmpeg/RELEASE_NOTES index a1ddd35..5bd3273 100644 --- a/ffmpeg/RELEASE_NOTES +++ b/ffmpeg/RELEASE_NOTES @@ -2,9 +2,13 @@ │ RELEASE NOTES for FFmpeg 2.5 "Bohr" │ └────────────────────────────────────────┘ - The FFmpeg Project proudly presents FFmpeg 2.5 "Bohr", just 2.5 months - after the release of 2.4. Since this wasn't a long time ago, the Changelog - is a bit short this time. + The FFmpeg Project proudly presents FFmpeg 2.5 "Bohr", 2.5 months after the + release of 2.4. + + The most important new features are AVFoundation screen-grabbing support, + animated WebP decoding support, and Animated PNG support. In addition, many + exciting features for video streaming are also implemented, including MPEG- + DASH fragmenting muxer, HEVC RTP payload muxer, and UDP Lite support. As usual, if you have any question on this release or any FFmpeg related topic, feel free to join us on the #ffmpeg IRC channel (on @@ -56,6 +60,7 @@ • libutvideo YUV 4:2:2 10bit support • animated WebP decoding support • zygoaudio decoding support + • APNG decoder ┌────────────────────────────┐ │ libavdevice │ @@ -72,7 +77,8 @@ • SUP/PGS subtitle demuxer • STL subtitle demuxer • UDP-Lite support (RFC 3828) - • creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer + • MPEG-DASH segmenting muxer, which allows creating DASH compatible + fragmented MP4 • WebP muxer • APNG demuxer @@ -93,7 +99,3 @@ └────────────────────────────┘ • visualization support - - ┌────────────────────────────┐ - │ ⚠ Behaviour changes │ - └────────────────────────────┘ diff --git a/ffmpeg/VERSION b/ffmpeg/VERSION index 95e3ba8..73462a5 100644 --- a/ffmpeg/VERSION +++ b/ffmpeg/VERSION @@ -1 +1 @@ -2.5 +2.5.1 diff --git a/ffmpeg/configure b/ffmpeg/configure index c046e34..ed50628 100755 --- a/ffmpeg/configure +++ b/ffmpeg/configure @@ -4883,7 +4883,7 @@ enabled libquvi && require_pkg_config libquvi quvi/quvi.h quvi_init enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer -enabled libsmbclient && { check_pkg_config smbclient libsmbclient.h smbc_init || +enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init || require smbclient libsmbclient.h smbc_init -lsmbclient; } enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init diff --git a/ffmpeg/doc/Doxyfile b/ffmpeg/doc/Doxyfile index a5b9640..73c16ce 100644 --- a/ffmpeg/doc/Doxyfile +++ b/ffmpeg/doc/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.5 +PROJECT_NUMBER = 2.5.1 # With the PROJECT_LOGO tag one can specify a logo or icon that is included # in the documentation. The maximum height of the logo should not exceed 55 diff --git a/ffmpeg/doc/examples/filtering_video.c b/ffmpeg/doc/examples/filtering_video.c index 8d59573..601c3d8 100644 --- a/ffmpeg/doc/examples/filtering_video.c +++ b/ffmpeg/doc/examples/filtering_video.c @@ -90,6 +90,7 @@ static int init_filters(const char *filters_descr) AVFilter *buffersink = avfilter_get_by_name("buffersink"); AVFilterInOut *outputs = avfilter_inout_alloc(); AVFilterInOut *inputs = avfilter_inout_alloc(); + AVRational time_base = fmt_ctx->streams[video_stream_index]->time_base; enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; filter_graph = avfilter_graph_alloc(); @@ -102,7 +103,7 @@ static int init_filters(const char *filters_descr) snprintf(args, sizeof(args), "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt, - dec_ctx->time_base.num, dec_ctx->time_base.den, + time_base.num, time_base.den, dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den); ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in", diff --git a/ffmpeg/doc/examples/transcoding.c b/ffmpeg/doc/examples/transcoding.c index 759c628..5572461 100644 --- a/ffmpeg/doc/examples/transcoding.c +++ b/ffmpeg/doc/examples/transcoding.c @@ -116,6 +116,10 @@ static int open_output_file(const char *filename) || dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) { /* in this example, we choose transcoding to same codec */ encoder = avcodec_find_encoder(dec_ctx->codec_id); + if (!encoder) { + av_log(NULL, AV_LOG_FATAL, "Neccessary encoder not found\n"); + return AVERROR_INVALIDDATA; + } /* In this example, we transcode to same properties (picture size, * sample rate etc.). These properties can be changed for output diff --git a/ffmpeg/libavcodec/mpegaudiodec_template.c b/ffmpeg/libavcodec/mpegaudiodec_template.c index bbd07c5..138a107 100644 --- a/ffmpeg/libavcodec/mpegaudiodec_template.c +++ b/ffmpeg/libavcodec/mpegaudiodec_template.c @@ -428,9 +428,11 @@ static av_cold int decode_init(AVCodecContext * avctx) s->avctx = avctx; +#if USE_FLOATS s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT); if (!s->fdsp) return AVERROR(ENOMEM); +#endif ff_mpadsp_init(&s->mpadsp); diff --git a/ffmpeg/libavcodec/ppc/vc1dsp_altivec.c b/ffmpeg/libavcodec/ppc/vc1dsp_altivec.c index 2128b56..35bb280 100644 --- a/ffmpeg/libavcodec/ppc/vc1dsp_altivec.c +++ b/ffmpeg/libavcodec/ppc/vc1dsp_altivec.c @@ -304,16 +304,23 @@ static void vc1_inv_trans_8x4_altivec(uint8_t *dest, int stride, int16_t *block) src2 = vec_pack(s2, sA); src3 = vec_pack(s3, sB); +#if HAVE_BIGENDIAN p0 = vec_lvsl (0, dest); p1 = vec_lvsl (stride, dest); p = vec_splat_u8 (-1); perm0 = vec_mergeh (p, p0); perm1 = vec_mergeh (p, p1); +#define GET_TMP2(dst, p) \ + tmp = vec_ld (0, dest); \ + tmp2 = (vector signed short)vec_perm (tmp, vec_splat_u8(0), p); +#else +#define GET_TMP2(dst,p) \ + tmp = vec_vsx_ld (0, dst); \ + tmp2 = (vector signed short)vec_mergeh (tmp, vec_splat_u8(0)); +#endif #define ADD(dest,src,perm) \ - /* *(uint64_t *)&tmp = *(uint64_t *)dest; */ \ - tmp = vec_ld (0, dest); \ - tmp2 = (vector signed short)vec_perm (tmp, vec_splat_u8(0), perm); \ + GET_TMP2(dest, perm); \ tmp3 = vec_adds (tmp2, src); \ tmp = vec_packsu (tmp3, tmp3); \ vec_ste ((vector unsigned int)tmp, 0, (unsigned int *)dest); \ diff --git a/ffmpeg/libavcodec/ppc/vp3dsp_altivec.c b/ffmpeg/libavcodec/ppc/vp3dsp_altivec.c index 9d81b3f..4a367b6 100644 --- a/ffmpeg/libavcodec/ppc/vp3dsp_altivec.c +++ b/ffmpeg/libavcodec/ppc/vp3dsp_altivec.c @@ -32,8 +32,13 @@ static const vec_s16 constants = {0, 64277, 60547, 54491, 46341, 36410, 25080, 12785}; +#if HAVE_BIGENDIAN static const vec_u8 interleave_high = {0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29}; +#else +static const vec_u8 interleave_high = + {2, 3, 18, 19, 6, 7, 22, 23, 10, 11, 26, 27, 14, 15, 30, 31}; +#endif #define IDCT_START \ vec_s16 A, B, C, D, Ad, Bd, Cd, Dd, E, F, G, H;\ @@ -156,9 +161,18 @@ static void vp3_idct_add_altivec(uint8_t *dst, int stride, int16_t block[64]) TRANSPOSE8(b0, b1, b2, b3, b4, b5, b6, b7); IDCT_1D(ADD8, SHIFT4) -#define ADD(a)\ +#if HAVE_BIGENDIAN +#define GET_VDST16\ vdst = vec_ld(0, dst);\ - vdst_16 = (vec_s16)vec_perm(vdst, zero_u8v, vdst_mask);\ + vdst_16 = (vec_s16)vec_perm(vdst, zero_u8v, vdst_mask); +#else +#define GET_VDST16\ + vdst = vec_vsx_ld(0,dst);\ + vdst_16 = (vec_s16)vec_mergeh(vdst, zero_u8v); +#endif + +#define ADD(a)\ + GET_VDST16;\ vdst_16 = vec_adds(a, vdst_16);\ t = vec_packsu(vdst_16, vdst_16);\ vec_ste((vec_u32)t, 0, (unsigned int *)dst);\ diff --git a/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c b/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c index 91ff8cc..23e4ace 100644 --- a/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c +++ b/ffmpeg/libavcodec/ppc/vp8dsp_altivec.c @@ -59,17 +59,30 @@ static const vec_s8 h_subpel_filters_outer[3] = vec_s8 filter_outerh = h_subpel_filters_outer[(i)>>1]; \ vec_s8 filter_outerl = vec_sld(filter_outerh, filter_outerh, 2) +#if HAVE_BIGENDIAN +#define GET_PIXHL(offset) \ + a = vec_ld((offset)-is6tap-1, src); \ + b = vec_ld((offset)-is6tap-1+15, src); \ + pixh = vec_perm(a, b, permh##offset); \ + pixl = vec_perm(a, b, perml##offset) + +#define GET_OUTER(offset) outer = vec_perm(a, b, perm_6tap##offset) +#else +#define GET_PIXHL(offset) \ + a = vec_vsx_ld((offset)-is6tap-1, src); \ + pixh = vec_perm(a, a, perm_inner); \ + pixl = vec_perm(a, a, vec_add(perm_inner, vec_splat_u8(4))) + +#define GET_OUTER(offset) outer = vec_perm(a, a, perm_outer) +#endif + #define FILTER_H(dstv, off) \ - a = vec_ld((off)-is6tap-1, src); \ - b = vec_ld((off)-is6tap-1+15, src); \ -\ - pixh = vec_perm(a, b, permh##off); \ - pixl = vec_perm(a, b, perml##off); \ + GET_PIXHL(off); \ filth = vec_msum(filter_inner, pixh, c64); \ filtl = vec_msum(filter_inner, pixl, c64); \ \ if (is6tap) { \ - outer = vec_perm(a, b, perm_6tap##off); \ + GET_OUTER(off); \ filth = vec_msum(filter_outerh, outer, filth); \ filtl = vec_msum(filter_outerl, outer, filtl); \ } \ @@ -84,9 +97,12 @@ void put_vp8_epel_h_altivec_core(uint8_t *dst, ptrdiff_t dst_stride, int h, int mx, int w, int is6tap) { LOAD_H_SUBPEL_FILTER(mx-1); - vec_u8 align_vec0, align_vec8, permh0, permh8, filt; +#if HAVE_BIGENDIAN + vec_u8 align_vec0, align_vec8, permh0, permh8; vec_u8 perm_6tap0, perm_6tap8, perml0, perml8; - vec_u8 a, b, pixh, pixl, outer; + vec_u8 b; +#endif + vec_u8 filt, a, pixh, pixl, outer; vec_s16 f16h, f16l; vec_s32 filth, filtl; @@ -97,6 +113,7 @@ void put_vp8_epel_h_altivec_core(uint8_t *dst, ptrdiff_t dst_stride, vec_s32 c64 = vec_sl(vec_splat_s32(1), vec_splat_u32(6)); vec_u16 c7 = vec_splat_u16(7); +#if HAVE_BIGENDIAN align_vec0 = vec_lvsl( -is6tap-1, src); align_vec8 = vec_lvsl(8-is6tap-1, src); @@ -107,6 +124,7 @@ void put_vp8_epel_h_altivec_core(uint8_t *dst, ptrdiff_t dst_stride, perml8 = vec_perm(align_vec8, align_vec8, perm_inner); perm_6tap0 = vec_perm(align_vec0, align_vec0, perm_outer); perm_6tap8 = vec_perm(align_vec8, align_vec8, perm_outer); +#endif while (h --> 0) { FILTER_H(f16h, 0); @@ -164,6 +182,12 @@ static const vec_u8 v_subpel_filters[7] = dstv = vec_adds(dstv, c64); \ dstv = vec_sra(dstv, c7) +#if HAVE_BIGENDIAN +#define LOAD_HL(off, s, perm) load_with_perm_vec(off, s, perm) +#else +#define LOAD_HL(off, s, perm) vec_mergeh(vec_vsx_ld(off,s), vec_vsx_ld(off+8,s)) +#endif + static av_always_inline void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, @@ -175,6 +199,7 @@ void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride, vec_s16 c64 = vec_sl(vec_splat_s16(1), vec_splat_u16(6)); vec_u16 c7 = vec_splat_u16(7); +#if HAVE_BIGENDIAN // we want pixels 0-7 to be in the even positions and 8-15 in the odd, // so combine this permute with the alignment permute vector align_vech = vec_lvsl(0, src); @@ -183,22 +208,23 @@ void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride, perm_vec = vec_mergeh(align_vech, align_vecl); else perm_vec = vec_mergeh(align_vech, align_vech); +#endif if (is6tap) - s0 = load_with_perm_vec(-2*src_stride, src, perm_vec); - s1 = load_with_perm_vec(-1*src_stride, src, perm_vec); - s2 = load_with_perm_vec( 0*src_stride, src, perm_vec); - s3 = load_with_perm_vec( 1*src_stride, src, perm_vec); + s0 = LOAD_HL(-2*src_stride, src, perm_vec); + s1 = LOAD_HL(-1*src_stride, src, perm_vec); + s2 = LOAD_HL( 0*src_stride, src, perm_vec); + s3 = LOAD_HL( 1*src_stride, src, perm_vec); if (is6tap) - s4 = load_with_perm_vec( 2*src_stride, src, perm_vec); + s4 = LOAD_HL( 2*src_stride, src, perm_vec); src += (2+is6tap)*src_stride; while (h --> 0) { if (is6tap) - s5 = load_with_perm_vec(0, src, perm_vec); + s5 = LOAD_HL(0, src, perm_vec); else - s4 = load_with_perm_vec(0, src, perm_vec); + s4 = LOAD_HL(0, src, perm_vec); FILTER_V(f16h, vec_mule); @@ -272,39 +298,25 @@ EPEL_HV(4, 4,4) static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) { - register vector unsigned char pixelsv1, pixelsv2; - register vector unsigned char pixelsv1B, pixelsv2B; - register vector unsigned char pixelsv1C, pixelsv2C; - register vector unsigned char pixelsv1D, pixelsv2D; - - register vector unsigned char perm = vec_lvsl(0, src); + register vector unsigned char perm; int i; register ptrdiff_t dstride2 = dstride << 1, sstride2 = sstride << 1; register ptrdiff_t dstride3 = dstride2 + dstride, sstride3 = sstride + sstride2; register ptrdiff_t dstride4 = dstride << 2, sstride4 = sstride << 2; +#if HAVE_BIGENDIAN + perm = vec_lvsl(0, src); +#endif // hand-unrolling the loop by 4 gains about 15% // mininum execution time goes from 74 to 60 cycles // it's faster than -funroll-loops, but using // -funroll-loops w/ this is bad - 74 cycles again. // all this is on a 7450, tuning for the 7450 for (i = 0; i < h; i += 4) { - pixelsv1 = vec_ld( 0, src); - pixelsv2 = vec_ld(15, src); - pixelsv1B = vec_ld(sstride, src); - pixelsv2B = vec_ld(15 + sstride, src); - pixelsv1C = vec_ld(sstride2, src); - pixelsv2C = vec_ld(15 + sstride2, src); - pixelsv1D = vec_ld(sstride3, src); - pixelsv2D = vec_ld(15 + sstride3, src); - vec_st(vec_perm(pixelsv1, pixelsv2, perm), - 0, (unsigned char*)dst); - vec_st(vec_perm(pixelsv1B, pixelsv2B, perm), - dstride, (unsigned char*)dst); - vec_st(vec_perm(pixelsv1C, pixelsv2C, perm), - dstride2, (unsigned char*)dst); - vec_st(vec_perm(pixelsv1D, pixelsv2D, perm), - dstride3, (unsigned char*)dst); + vec_st(load_with_perm_vec(0, src, perm), 0, dst); + vec_st(load_with_perm_vec(sstride, src, perm), dstride, dst); + vec_st(load_with_perm_vec(sstride2, src, perm), dstride2, dst); + vec_st(load_with_perm_vec(sstride3, src, perm), dstride3, dst); src += sstride4; dst += dstride4; } diff --git a/ffmpeg/libavformat/aviobuf.c b/ffmpeg/libavformat/aviobuf.c index f374314..0b0748e 100644 --- a/ffmpeg/libavformat/aviobuf.c +++ b/ffmpeg/libavformat/aviobuf.c @@ -223,6 +223,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence) return offset1; offset += offset1; } + if (offset < 0) + return AVERROR(EINVAL); + offset1 = offset - pos; if (!s->must_flush && (!s->direct || !s->seek) && offset1 >= 0 && offset1 <= buffer_size) { diff --git a/ffmpeg/libavformat/crypto.c b/ffmpeg/libavformat/crypto.c index c1754b0..22529fb 100644 --- a/ffmpeg/libavformat/crypto.c +++ b/ffmpeg/libavformat/crypto.c @@ -122,7 +122,7 @@ static int crypto_open2(URLContext *h, const char *uri, int flags, AVDictionary c->key, c->keylen, "decryption key")) < 0) goto err; if ((ret = set_aes_arg(c, &c->decrypt_iv, &c->decrypt_ivlen, - c->key, c->keylen, "decryption IV")) < 0) + c->iv, c->ivlen, "decryption IV")) < 0) goto err; } @@ -132,7 +132,7 @@ static int crypto_open2(URLContext *h, const char *uri, int flags, AVDictionary if (ret < 0) goto err; if ((ret = set_aes_arg(c, &c->encrypt_iv, &c->encrypt_ivlen, - c->key, c->keylen, "encryption IV")) < 0) + c->iv, c->ivlen, "encryption IV")) < 0) goto err; } diff --git a/ffmpeg/libavformat/flvdec.c b/ffmpeg/libavformat/flvdec.c index 17d1313..c64b3a9 100644 --- a/ffmpeg/libavformat/flvdec.c +++ b/ffmpeg/libavformat/flvdec.c @@ -459,11 +459,11 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, } if (key) { + acodec = astream ? astream->codec : NULL; + vcodec = vstream ? vstream->codec : NULL; + // stream info doesn't live any deeper than the first object if (depth == 1) { - acodec = astream ? astream->codec : NULL; - vcodec = vstream ? vstream->codec : NULL; - if (amf_type == AMF_DATA_TYPE_NUMBER || amf_type == AMF_DATA_TYPE_BOOL) { if (!strcmp(key, "duration")) diff --git a/ffmpeg/libavformat/matroskadec.c b/ffmpeg/libavformat/matroskadec.c index c81b5a0..e9ba1e9 100644 --- a/ffmpeg/libavformat/matroskadec.c +++ b/ffmpeg/libavformat/matroskadec.c @@ -1414,13 +1414,17 @@ static void matroska_execute_seekhead(MatroskaDemuxContext *matroska) EbmlList *seekhead_list = &matroska->seekhead; int64_t before_pos = avio_tell(matroska->ctx->pb); int i; + int nb_elem; // we should not do any seeking in the streaming case if (!matroska->ctx->pb->seekable || (matroska->ctx->flags & AVFMT_FLAG_IGNIDX)) return; - for (i = 0; i < seekhead_list->nb_elem; i++) { + // do not read entries that are added while parsing seekhead entries + nb_elem = seekhead_list->nb_elem; + + for (i = 0; i < nb_elem; i++) { MatroskaSeekhead *seekhead = seekhead_list->elem; if (seekhead[i].pos <= before_pos) continue; diff --git a/ffmpeg/libavformat/utils.c b/ffmpeg/libavformat/utils.c index 798c612..ae6347a 100644 --- a/ffmpeg/libavformat/utils.c +++ b/ffmpeg/libavformat/utils.c @@ -594,6 +594,8 @@ static int update_wrap_reference(AVFormatContext *s, AVStream *st, int stream_in int default_stream_index = av_find_default_stream_index(s); if (s->streams[default_stream_index]->pts_wrap_reference == AV_NOPTS_VALUE) { for (i = 0; i < s->nb_streams; i++) { + if (av_find_program_from_stream(s, NULL, i)) + continue; s->streams[i]->pts_wrap_reference = pts_wrap_reference; s->streams[i]->pts_wrap_behavior = pts_wrap_behavior; } diff --git a/ffmpeg/libavutil/frame.c b/ffmpeg/libavutil/frame.c index 4ee0630..5c9aa29 100644 --- a/ffmpeg/libavutil/frame.c +++ b/ffmpeg/libavutil/frame.c @@ -503,6 +503,7 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src) free_side_data(&dst->side_data[i]); } av_freep(&dst->side_data); + dst->nb_side_data = 0; return AVERROR(ENOMEM); } memcpy(sd_dst->data, sd_src->data, sd_src->size); diff --git a/ffmpeg/libswresample/soxr_resample.c b/ffmpeg/libswresample/soxr_resample.c index 064451d..9e87f2f 100644 --- a/ffmpeg/libswresample/soxr_resample.c +++ b/ffmpeg/libswresample/soxr_resample.c @@ -76,8 +76,12 @@ static int process( AudioData *src, int src_size, int *consumed){ size_t idone, odone; soxr_error_t error = soxr_set_error((soxr_t)c, soxr_set_num_channels((soxr_t)c, src->ch_count)); - error = soxr_process((soxr_t)c, src->ch, (size_t)src_size, - &idone, dst->ch, (size_t)dst_size, &odone); + if (!error) + error = soxr_process((soxr_t)c, src->ch, (size_t)src_size, + &idone, dst->ch, (size_t)dst_size, &odone); + else + idone = 0; + *consumed = (int)idone; return error? -1 : odone; } -- 2.34.1