[FFmpeg-cvslog] doc/filters: add small description to geq filter section
ffmpeg | branch: master | Paul B Mahol | Mon Oct 29 16:44:23 2018 +0100| [7e1add2c51d7dd791123a6246dfa1b4cf29239e6] | committer: Paul B Mahol doc/filters: add small description to geq filter section Previously there was no description at all. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7e1add2c51d7dd791123a6246dfa1b4cf29239e6 --- doc/filters.texi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/filters.texi b/doc/filters.texi index 9c7cc2284b..9b84b1145b 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -10121,6 +10121,8 @@ Default is @code{-1}. @section geq +Apply generic equation to each pixel. + The filter accepts the following options: @table @option ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/vp3: Do not initialize unused tables for keyframes in unpack_superblock()
ffmpeg | branch: master | Michael Niedermayer | Sun Oct 28 12:46:52 2018 +0100| [88e3807aafd3ed50f3963c477fa92495491793e2] | committer: Michael Niedermayer avcodec/vp3: Do not initialize unused tables for keyframes in unpack_superblock() Fixes: Timeout (139sec -> 102sec) Fixes: 9642/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP3_fuzzer-6676767875006464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=88e3807aafd3ed50f3963c477fa92495491793e2 --- libavcodec/vp3.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 0e6da89abb..348416b25d 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -544,8 +544,21 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) : s->y_superblock_count); int num_coded_frags = 0; +if (s->keyframe) { +for (i = sb_start; i < sb_end; i++) { +/* iterate through all 16 fragments in a superblock */ +for (j = 0; j < 16; j++) { +/* if the fragment is in bounds, check its coding status */ +current_fragment = s->superblock_fragments[i * 16 + j]; +if (current_fragment != -1) { +s->coded_fragment_list[plane][num_coded_frags++] = +current_fragment; +} +} +} +} else { for (i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) { -if (s->keyframe == 0 && get_bits_left(gb) < plane0_num_coded_frags >> 2) { +if (get_bits_left(gb) < plane0_num_coded_frags >> 2) { return AVERROR_INVALIDDATA; } /* iterate through all 16 fragments in a superblock */ @@ -580,6 +593,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) } } } +} if (!plane) plane0_num_coded_frags = num_coded_frags; s->total_num_coded_frags += num_coded_frags; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/vp3: Do not recalculate coded_fragment_list for keyframes
ffmpeg | branch: master | Michael Niedermayer | Sun Oct 28 14:44:37 2018 +0100| [b5e7e437f4c85ccc676399e092acaea80d1386b9] | committer: Michael Niedermayer avcodec/vp3: Do not recalculate coded_fragment_list for keyframes This improves decoding speed of keyframes Fixes: Timeout (102->27sec) Fixes: 9642/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP3_fuzzer-6676767875006464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b5e7e437f4c85ccc676399e092acaea80d1386b9 --- libavcodec/vp3.c | 41 + 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index d8421a8315..bf1c0c 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -223,6 +223,10 @@ typedef struct Vp3DecodeContext { * which of the fragments are coded */ int *coded_fragment_list[3]; +int *kf_coded_fragment_list; +int *nkf_coded_fragment_list; +int num_kf_coded_fragment[3]; + VLC dc_vlc[16]; VLC ac_vlc_1[16]; VLC ac_vlc_2[16]; @@ -271,7 +275,8 @@ static av_cold void free_tables(AVCodecContext *avctx) av_freep(&s->superblock_coding); av_freep(&s->all_fragments); -av_freep(&s->coded_fragment_list[0]); +av_freep(&s->nkf_coded_fragment_list); +av_freep(&s->kf_coded_fragment_list); av_freep(&s->dct_tokens_base); av_freep(&s->superblock_fragments); av_freep(&s->macroblock_coding); @@ -538,6 +543,9 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) s->total_num_coded_frags = 0; memset(s->macroblock_coding, MODE_COPY, s->macroblock_count); +s->coded_fragment_list[0] = s->keyframe ? s->kf_coded_fragment_list +: s->nkf_coded_fragment_list; + for (plane = 0; plane < 3; plane++) { int sb_start = superblock_starts[plane]; int sb_end = sb_start + (plane ? s->c_superblock_count @@ -545,17 +553,21 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) int num_coded_frags = 0; if (s->keyframe) { -for (i = sb_start; i < sb_end; i++) { -/* iterate through all 16 fragments in a superblock */ -for (j = 0; j < 16; j++) { -/* if the fragment is in bounds, check its coding status */ -current_fragment = s->superblock_fragments[i * 16 + j]; -if (current_fragment != -1) { -s->coded_fragment_list[plane][num_coded_frags++] = -current_fragment; +if (s->num_kf_coded_fragment[plane] == -1) { +for (i = sb_start; i < sb_end; i++) { +/* iterate through all 16 fragments in a superblock */ +for (j = 0; j < 16; j++) { +/* if the fragment is in bounds, check its coding status */ +current_fragment = s->superblock_fragments[i * 16 + j]; +if (current_fragment != -1) { +s->coded_fragment_list[plane][num_coded_frags++] = +current_fragment; +} } } -} +s->num_kf_coded_fragment[plane] = num_coded_frags; +} else +num_coded_frags = s->num_kf_coded_fragment[plane]; } else { for (i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) { if (get_bits_left(gb) < plane0_num_coded_frags >> 2) { @@ -1705,7 +1717,9 @@ static av_cold int allocate_tables(AVCodecContext *avctx) s->superblock_coding = av_mallocz(s->superblock_count); s->all_fragments = av_mallocz_array(s->fragment_count, sizeof(Vp3Fragment)); -s->coded_fragment_list[0] = av_mallocz_array(s->fragment_count, sizeof(int)); +s-> kf_coded_fragment_list = av_mallocz_array(s->fragment_count, sizeof(int)); +s->nkf_coded_fragment_list = av_mallocz_array(s->fragment_count, sizeof(int)); +memset(s-> num_kf_coded_fragment, -1, sizeof(s-> num_kf_coded_fragment)); s->dct_tokens_base = av_mallocz_array(s->fragment_count, 64 * sizeof(*s->dct_tokens_base)); @@ -1717,7 +1731,8 @@ static av_cold int allocate_tables(AVCodecContext *avctx) s->macroblock_coding= av_mallocz(s->macroblock_count + 1); if (!s->superblock_coding|| !s->all_fragments || -!s->dct_tokens_base || !s->coded_fragment_list[0] || +!s->dct_tokens_base || !s->kf_coded_fragment_list || +!s->nkf_coded_fragment_list || !s->superblock_fragments || !s->macroblock_coding || !s->motion_val[0]|| !s->motion_val[1]) { vp3_decode_end(avctx); @@ -2271,6 +22
[FFmpeg-cvslog] avcodec/vp3: Reuse local variable in unpack_superblocks()
ffmpeg | branch: master | Michael Niedermayer | Sun Oct 28 12:49:40 2018 +0100| [f563180817774e5fdd17e32992dce4fa01dbf881] | committer: Michael Niedermayer avcodec/vp3: Reuse local variable in unpack_superblocks() Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f563180817774e5fdd17e32992dce4fa01dbf881 --- libavcodec/vp3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 348416b25d..d8421a8315 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -568,7 +568,7 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) if (current_fragment != -1) { int coded = s->superblock_coding[i]; -if (s->superblock_coding[i] == SB_PARTIALLY_CODED) { +if (coded == SB_PARTIALLY_CODED) { /* fragment may or may not be coded; this is the case * that cares about the fragment coding runs */ if (current_run-- == 0) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/vp3: reindent unpack_superblocks()
ffmpeg | branch: master | Michael Niedermayer | Mon Oct 29 16:28:20 2018 +0100| [4885ff663bec7e971200c5f0b34c1c27bad07182] | committer: Michael Niedermayer avcodec/vp3: reindent unpack_superblocks() Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4885ff663bec7e971200c5f0b34c1c27bad07182 --- libavcodec/vp3.c | 62 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index bf1c0c..9df2fda49d 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -569,43 +569,43 @@ static int unpack_superblocks(Vp3DecodeContext *s, GetBitContext *gb) } else num_coded_frags = s->num_kf_coded_fragment[plane]; } else { -for (i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) { -if (get_bits_left(gb) < plane0_num_coded_frags >> 2) { -return AVERROR_INVALIDDATA; -} -/* iterate through all 16 fragments in a superblock */ -for (j = 0; j < 16; j++) { -/* if the fragment is in bounds, check its coding status */ -current_fragment = s->superblock_fragments[i * 16 + j]; -if (current_fragment != -1) { -int coded = s->superblock_coding[i]; - -if (coded == SB_PARTIALLY_CODED) { -/* fragment may or may not be coded; this is the case - * that cares about the fragment coding runs */ -if (current_run-- == 0) { -bit^= 1; -current_run = get_vlc2(gb, s->fragment_run_length_vlc.table, 5, 2); +for (i = sb_start; i < sb_end && get_bits_left(gb) > 0; i++) { +if (get_bits_left(gb) < plane0_num_coded_frags >> 2) { +return AVERROR_INVALIDDATA; +} +/* iterate through all 16 fragments in a superblock */ +for (j = 0; j < 16; j++) { +/* if the fragment is in bounds, check its coding status */ +current_fragment = s->superblock_fragments[i * 16 + j]; +if (current_fragment != -1) { +int coded = s->superblock_coding[i]; + +if (coded == SB_PARTIALLY_CODED) { +/* fragment may or may not be coded; this is the case + * that cares about the fragment coding runs */ +if (current_run-- == 0) { +bit^= 1; +current_run = get_vlc2(gb, s->fragment_run_length_vlc.table, 5, 2); +} +coded = bit; } -coded = bit; -} -if (coded) { -/* default mode; actual mode will be decoded in - * the next phase */ -s->all_fragments[current_fragment].coding_method = -MODE_INTER_NO_MV; -s->coded_fragment_list[plane][num_coded_frags++] = -current_fragment; -} else { -/* not coded; copy this fragment from the prior frame */ -s->all_fragments[current_fragment].coding_method = -MODE_COPY; +if (coded) { +/* default mode; actual mode will be decoded in + * the next phase */ +s->all_fragments[current_fragment].coding_method = +MODE_INTER_NO_MV; +s->coded_fragment_list[plane][num_coded_frags++] = +current_fragment; +} else { +/* not coded; copy this fragment from the prior frame */ +s->all_fragments[current_fragment].coding_method = +MODE_COPY; +} } } } } -} if (!plane) plane0_num_coded_frags = num_coded_frags; s->total_num_coded_frags += num_coded_frags; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] vaapi_encode_mpeg2: Fix width/height columns/rows confusion
ffmpeg | branch: master | Mark Thompson | Mon Oct 29 19:41:24 2018 +| [c0692cb2bb3b51660b501f14bd344005c68df465] | committer: Mark Thompson vaapi_encode_mpeg2: Fix width/height columns/rows confusion Fixes #7522. > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c0692cb2bb3b51660b501f14bd344005c68df465 --- libavcodec/vaapi_encode_mpeg2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c index 99a8b43237..22d7e306bb 100644 --- a/libavcodec/vaapi_encode_mpeg2.c +++ b/libavcodec/vaapi_encode_mpeg2.c @@ -545,8 +545,8 @@ static av_cold int vaapi_encode_mpeg2_configure(AVCodecContext *avctx) av_assert0(0 && "Invalid RC mode."); } -ctx->slice_block_rows = FFALIGN(avctx->width, 16) / 16; -ctx->slice_block_cols = FFALIGN(avctx->height, 16) / 16; +ctx->slice_block_rows = FFALIGN(avctx->height, 16) / 16; +ctx->slice_block_cols = FFALIGN(avctx->width, 16) / 16; ctx->nb_slices = ctx->slice_block_rows; ctx->slice_size = 1; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/vp9: Check in decode_tiles() if there is data remaining
ffmpeg | branch: master | Michael Niedermayer | Sat Aug 4 22:21:02 2018 +0200| [78862488f85207633f29f5a66e42364024a14c3f] | committer: Michael Niedermayer avcodec/vp9: Check in decode_tiles() if there is data remaining Fixes: Timeout Fixes: 9330/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP9_fuzzer-5707345857347584 Fixes: 9775/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP9_fuzzer-5643845344690176 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=78862488f85207633f29f5a66e42364024a14c3f --- libavcodec/vp9.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index b1178c9c0c..acf3ffc9e7 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -1306,6 +1306,9 @@ static int decode_tiles(AVCodecContext *avctx, decode_sb_mem(td, row, col, lflvl_ptr, yoff2, uvoff2, BL_64X64); } else { +if (vpX_rac_is_end(td->c)) { +return AVERROR_INVALIDDATA; +} decode_sb(td, row, col, lflvl_ptr, yoff2, uvoff2, BL_64X64); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/vp56: Add vpX_rac_is_end() to check for the end of input
ffmpeg | branch: master | Michael Niedermayer | Sat Aug 11 22:28:31 2018 +0200| [0fb83b4c91d5a0784ca81df4283f25740c263f20] | committer: Michael Niedermayer avcodec/vp56: Add vpX_rac_is_end() to check for the end of input Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0fb83b4c91d5a0784ca81df4283f25740c263f20 --- libavcodec/vp56.h | 8 1 file changed, 8 insertions(+) diff --git a/libavcodec/vp56.h b/libavcodec/vp56.h index b8dda9e73a..70e1d38a83 100644 --- a/libavcodec/vp56.h +++ b/libavcodec/vp56.h @@ -227,6 +227,14 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, extern const uint8_t ff_vp56_norm_shift[256]; int ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size); +/** + * vp5689 returns 1 if the end of the stream has been reached, 0 otherwise. + */ +static av_always_inline int vpX_rac_is_end(VP56RangeCoder *c) +{ +return c->end <= c->buffer && c->bits >= 0; +} + static av_always_inline unsigned int vp56_rac_renorm(VP56RangeCoder *c) { int shift = ff_vp56_norm_shift[c->high]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/hlsenc: fix the duration of m4s segment is unusually smaller than expected.
ffmpeg | branch: master | Charles Liu | Tue Oct 30 11:07:14 2018 +0800| [3d1b7954933b17fc8ff5204e231f63fcb7ff63a9] | committer: Steven Liu avformat/hlsenc: fix the duration of m4s segment is unusually smaller than expected. In fmp4 mode, the duration of the second m4s segment is unusually smaller than the expected segment time. Signed-off-by: Charles Liu Signed-off-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d1b7954933b17fc8ff5204e231f63fcb7ff63a9 --- libavformat/hlsenc.c | 4 1 file changed, 4 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 28c2dd62fc..3ccd8756f6 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2233,10 +2233,6 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) } } -if (vs->fmp4_init_mode) { -vs->number--; -} - if (hls->segment_type == SEGMENT_TYPE_FMP4) { if (hls->flags & HLS_SINGLE_FILE) { ret = flush_dynbuf(vs, &range_length); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/hlsenc.c: fix the output's duration smaller than input's in sub-range mode.
ffmpeg | branch: master | Charles Liu | Tue Oct 30 11:11:27 2018 +0800| [1ff4bd59dfcea26b584e8c82a6cd7c3ee87fc8a7] | committer: Steven Liu avformat/hlsenc.c: fix the output's duration smaller than input's in sub-range mode. In fmp4 & sub-range mode, the output's duration always smaller than expected, because the size of the last #EXT-X-BYTERANGE is too small. Signed-off-by: Charles Liu Signed-off-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1ff4bd59dfcea26b584e8c82a6cd7c3ee87fc8a7 --- libavformat/hlsenc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 8b3a9b78f4..f8f060d065 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2380,6 +2380,7 @@ static int hls_write_trailer(struct AVFormatContext *s) if (ret < 0) { goto failed; } +vs->size = range_length; ff_format_io_close(s, &vs->out); } @@ -2388,8 +2389,6 @@ failed: if (oc->pb) { if (hls->segment_type != SEGMENT_TYPE_FMP4) { vs->size = avio_tell(vs->avf->pb) - vs->start_pos; -} else { -vs->size = avio_tell(vs->avf->pb); } if (hls->segment_type != SEGMENT_TYPE_FMP4) ff_format_io_close(s, &oc->pb); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/hlsenc.c: remove the useless variable fmp4_init_mode.
ffmpeg | branch: master | Charles Liu | Tue Oct 30 11:09:14 2018 +0800| [2365f47bf51a77442034fd8aa0af0346a373388b] | committer: Steven Liu avformat/hlsenc.c: remove the useless variable fmp4_init_mode. Signed-off-by: Charles Liu Signed-off-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2365f47bf51a77442034fd8aa0af0346a373388b --- libavformat/hlsenc.c | 4 1 file changed, 4 deletions(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index c322b5a48f..0fd5d2a995 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -147,7 +147,6 @@ typedef struct VariantStream { char *fmp4_init_filename; char *base_output_dirname; -int fmp4_init_mode; AVStream **streams; char codec_attr[128]; @@ -733,7 +732,6 @@ static int hls_mux_init(AVFormatContext *s, VariantStream *vs) vs->packets_written = 1; vs->start_pos = 0; vs->new_start = 1; -vs->fmp4_init_mode = 0; if (hls->segment_type == SEGMENT_TYPE_FMP4) { if (hls->max_seg_size > 0) { @@ -743,7 +741,6 @@ static int hls_mux_init(AVFormatContext *s, VariantStream *vs) vs->packets_written = 0; vs->init_range_length = 0; -vs->fmp4_init_mode = !byterange_mode; set_http_options(s, &options, hls); if ((ret = avio_open_dyn_buf(&oc->pb)) < 0) return ret; @@ -2291,7 +2288,6 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) vs->start_pos += vs->size; } -vs->fmp4_init_mode = 0; if (hls->flags & HLS_SINGLE_FILE) { vs->number++; } else if (hls->max_seg_size > 0) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/hlsenc.c: fix memory leak in fmp4 mode.
ffmpeg | branch: master | Charles Liu | Tue Oct 30 11:08:29 2018 +0800| [e9dbd62cb5f167c99298467db54d56c61a6be74f] | committer: Steven Liu avformat/hlsenc.c: fix memory leak in fmp4 mode. Signed-off-by: Charles Liu Signed-off-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e9dbd62cb5f167c99298467db54d56c61a6be74f --- libavformat/hlsenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 3ccd8756f6..c322b5a48f 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2205,6 +2205,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) avio_flush(oc->pb); range_length = avio_close_dyn_buf(oc->pb, &buffer); avio_write(vs->out, buffer, range_length); +av_free(buffer); vs->init_range_length = range_length; avio_open_dyn_buf(&oc->pb); vs->packets_written = 0; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avformat/hlsenc.c: the size of init.mp4 is zero.
ffmpeg | branch: master | Charles Liu | Tue Oct 30 11:10:27 2018 +0800| [76b8e42c1f0453215244c45114d5aa302e2add7b] | committer: Steven Liu avformat/hlsenc.c: the size of init.mp4 is zero. The size of init.mp4 is zero in fmp4 mode, when the input duraton smaller than the expected segment time. fix ticket: 7166 Signed-off-by: Charles Liu Signed-off-by: Steven Liu > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=76b8e42c1f0453215244c45114d5aa302e2add7b --- libavformat/hlsenc.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 0fd5d2a995..8b3a9b78f4 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2348,6 +2348,25 @@ static int hls_write_trailer(struct AVFormatContext *s) return AVERROR(ENOMEM); } if ( hls->segment_type == SEGMENT_TYPE_FMP4) { +if (!vs->init_range_length) { +av_write_frame(vs->avf, NULL); /* Flush any buffered data */ +avio_flush(oc->pb); + +uint8_t *buffer = NULL; +int range_length = avio_close_dyn_buf(oc->pb, &buffer); +avio_write(vs->out, buffer, range_length); +av_free(buffer); +vs->init_range_length = range_length; +avio_open_dyn_buf(&oc->pb); +vs->packets_written = 0; +vs->start_pos = range_length; +int byterange_mode = (hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size > 0); +if (!byterange_mode) { +ff_format_io_close(s, &vs->out); +hlsenc_io_close(s, &vs->out, vs->base_output_dirname); +} +} + int range_length = 0; if (!(hls->flags & HLS_SINGLE_FILE)) { ret = hlsenc_io_open(s, &vs->out, vs->avf->url, NULL); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavu/frame: Add error report if av_image_fill_pointers fail.
ffmpeg | branch: master | Jun Zhao | Sun Oct 28 10:44:29 2018 +0800| [f3bcb9c16a427934a681558a24202bd118e0aa06] | committer: Jun Zhao lavu/frame: Add error report if av_image_fill_pointers fail. Add error handle if av_image_fill_pointers fail. Signed-off-by: Jun Zhao Reviewed-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f3bcb9c16a427934a681558a24202bd118e0aa06 --- libavutil/frame.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libavutil/frame.c b/libavutil/frame.c index 92626dccf2..9b3fb13e68 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -243,11 +243,13 @@ static int get_video_buffer(AVFrame *frame, int align) return ret; frame->buf[0] = av_buffer_alloc(ret + 4*plane_padding); -if (!frame->buf[0]) +if (!frame->buf[0]) { +ret = AVERROR(ENOMEM); goto fail; +} -if (av_image_fill_pointers(frame->data, frame->format, padded_height, - frame->buf[0]->data, frame->linesize) < 0) +if ((ret = av_image_fill_pointers(frame->data, frame->format, padded_height, + frame->buf[0]->data, frame->linesize)) < 0) goto fail; for (i = 1; i < 4; i++) { @@ -260,7 +262,7 @@ static int get_video_buffer(AVFrame *frame, int align) return 0; fail: av_frame_unref(frame); -return AVERROR(ENOMEM); +return ret; } static int get_audio_buffer(AVFrame *frame, int align) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/decode: Fix the error number report if av_image_fill_pointers fail.
ffmpeg | branch: master | Jun Zhao | Sun Oct 28 10:27:22 2018 +0800| [903f2beafc7c5379ff65a7ca9b9e7b7ee49c75bf] | committer: Jun Zhao lavc/decode: Fix the error number report if av_image_fill_pointers fail. -1 will be map to error number "EPERM", and will be map to the error message like "Error while decoding stream #0:0: Operation not permitted", it's a strange error message when debug update_frame_pool fail, now only return the error code from av_image_fill_pointers in case of av_image_fill_pointers failure. Signed-off-by: Jun Zhao > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=903f2beafc7c5379ff65a7ca9b9e7b7ee49c75bf --- libavcodec/decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 2e82f6b506..c89c77c43a 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -1496,7 +1496,7 @@ static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame) tmpsize = av_image_fill_pointers(data, avctx->pix_fmt, h, NULL, linesize); if (tmpsize < 0) -return -1; +return tmpsize; for (i = 0; i < 3 && data[i + 1]; i++) size[i] = data[i + 1] - data[i]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avcodec/libvpxdec: fix setting auto threads
ffmpeg | branch: master | James Zern | Sat Oct 27 13:09:27 2018 -0700| [32d021cfa6520c53da23a10732f9ae9cf28ea948] | committer: James Zern avcodec/libvpxdec: fix setting auto threads a thread count of 0 is treated the same as 1, use av_cpu_count() to get the correct thread count when auto threads is requested. this matches the fix in libvpxenc: 27df34bf1f avcodec/libvpxenc: fix setting amount of threads used for encoding Reviewed-by: James Almer Signed-off-by: James Zern > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=32d021cfa6520c53da23a10732f9ae9cf28ea948 --- libavcodec/libvpxdec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c index 04f27d3396..164dbda49b 100644 --- a/libavcodec/libvpxdec.c +++ b/libavcodec/libvpxdec.c @@ -47,8 +47,7 @@ static av_cold int vpx_init(AVCodecContext *avctx, { VPxContext *ctx = avctx->priv_data; struct vpx_codec_dec_cfg deccfg = { -/* token partitions+1 would be a decent choice */ -.threads = FFMIN(avctx->thread_count, 16) +.threads = FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16) }; av_log(avctx, AV_LOG_INFO, "%s\n", vpx_codec_version_str()); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog