]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agoavdevice/xcbgrab: fix packet timestamps
Marton Balint [Sat, 28 Dec 2019 00:12:28 +0000 (01:12 +0100)]
avdevice/xcbgrab: fix packet timestamps

Since 648b8cca6c56a4fa1760efc72dfe1363a5c6e31e and
c991e9cd91845044e93a9c89dd25b48ae707461b timestamps were not set properly.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/vf_histogram: add envelope to thistogram filter
Paul B Mahol [Mon, 30 Dec 2019 16:21:35 +0000 (17:21 +0100)]
avfilter/vf_histogram: add envelope to thistogram filter

4 years agoavfilter/buffersrc: deprecate sws_param option
Zhao Zhili [Mon, 30 Dec 2019 05:01:38 +0000 (13:01 +0800)]
avfilter/buffersrc: deprecate sws_param option

4 years agoavfilter/af_crystalizer: add support for commands
Paul B Mahol [Sun, 29 Dec 2019 14:31:11 +0000 (15:31 +0100)]
avfilter/af_crystalizer: add support for commands

4 years agoavfilter/af_crystalizer: add timeline support
Paul B Mahol [Sun, 29 Dec 2019 14:28:53 +0000 (15:28 +0100)]
avfilter/af_crystalizer: add timeline support

4 years agoavfilter/vf_waveform: add support for 12bit yuva formats
Paul B Mahol [Sun, 29 Dec 2019 11:18:44 +0000 (12:18 +0100)]
avfilter/vf_waveform: add support for 12bit yuva formats

4 years agoavfilter/vf_vectorscope: add support for 12bit yuva formats
Paul B Mahol [Sun, 29 Dec 2019 11:13:21 +0000 (12:13 +0100)]
avfilter/vf_vectorscope: add support for 12bit yuva formats

4 years agoavfilter/vf_histogram: add support for 12bit yuva formats
Paul B Mahol [Sun, 29 Dec 2019 11:09:21 +0000 (12:09 +0100)]
avfilter/vf_histogram: add support for 12bit yuva formats

4 years agoavfilter/vf_histogram: reindent after previous commit
Paul B Mahol [Thu, 26 Dec 2019 20:22:26 +0000 (21:22 +0100)]
avfilter/vf_histogram: reindent after previous commit

4 years agoavfilter: add thistogram video filter
Paul B Mahol [Thu, 26 Dec 2019 10:38:53 +0000 (11:38 +0100)]
avfilter: add thistogram video filter

4 years agolavc/qsv: remove the unused funtion ff_qsv_profile_to_mfx()
Zhong Li [Sat, 28 Dec 2019 14:58:02 +0000 (22:58 +0800)]
lavc/qsv: remove the unused funtion ff_qsv_profile_to_mfx()

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agolavc/qsvdec: disable gpu copy when not supported
Zhong Li [Sat, 28 Dec 2019 14:28:45 +0000 (22:28 +0800)]
lavc/qsvdec: disable gpu copy when not supported

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agolavc/qsvdec: fix the error retrun code in ff_qsv_get_continuous_buffer()
Zhong Li [Sat, 28 Dec 2019 14:22:07 +0000 (22:22 +0800)]
lavc/qsvdec: fix the error retrun code in ff_qsv_get_continuous_buffer()

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agoavformat/matroskadec: Fix lzo decompression
Andreas Rheinhardt [Sat, 28 Dec 2019 02:40:33 +0000 (03:40 +0100)]
avformat/matroskadec: Fix lzo decompression

When a Matroska Block is only stored in compressed form, the size of
the uncompressed block is not explicitly coded and therefore not known
before decompressing it. Therefore the demuxer uses a guess for the
uncompressed size: The first guess is three times the compressed size
and if this is not enough, it is repeatedly incremented by a factor of
three. But when this happens with lzo, the decompression is neither
resumed nor started again. Instead when av_lzo1x_decode indicates that x
bytes of input data could not be decoded, because the output buffer is
already full, the first (not the last) x bytes of the input buffer are
resent for decoding in the next try; they overwrite already decoded
data.

This commit fixes this by instead restarting the decompression anew,
just with a bigger buffer.

This seems to be a regression since 935ec5a1.

A FATE-test for this has been added.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agofate/matroska: Add test for ProRes and bz2 compression
Andreas Rheinhardt [Sat, 28 Dec 2019 02:40:32 +0000 (03:40 +0100)]
fate/matroska: Add test for ProRes and bz2 compression

This test tests that demuxing ProRes that is muxed like it should be in
Matroska (i.e. with the first header ("icpf") atom stripped away) works;
it also tests bz2 decompression as well as the handling of
unknown-length clusters.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/vf_vectorscope: use av_clip_uint8()
James Almer [Sun, 29 Dec 2019 01:38:52 +0000 (22:38 -0300)]
avfilter/vf_vectorscope: use av_clip_uint8()

Fixes fate-source

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/vf_waveform: implement tint options
Paul B Mahol [Sat, 28 Dec 2019 18:50:33 +0000 (19:50 +0100)]
avfilter/vf_waveform: implement tint options

4 years agoavfilter/vf_vectorscope: improve tint output for gbrp formats
Paul B Mahol [Sat, 28 Dec 2019 19:25:37 +0000 (20:25 +0100)]
avfilter/vf_vectorscope: improve tint output for gbrp formats

4 years agofftools/ffmpeg_opt: Add a missing closing brackets.
Carl Eugen Hoyos [Sat, 28 Dec 2019 19:11:01 +0000 (20:11 +0100)]
fftools/ffmpeg_opt: Add a missing closing brackets.

Fixes ticket #8447.

4 years agoavfilter/vf_vectorscope: rename gray mode to tint mode
Paul B Mahol [Sat, 28 Dec 2019 12:27:46 +0000 (13:27 +0100)]
avfilter/vf_vectorscope: rename gray mode to tint mode

4 years agoavfilter/vf_vectorscope: add invert graticule
Paul B Mahol [Sat, 28 Dec 2019 11:31:04 +0000 (12:31 +0100)]
avfilter/vf_vectorscope: add invert graticule

4 years agoavfilter/vf_vectorscope: use enum for graticule items
Paul B Mahol [Sat, 28 Dec 2019 10:08:22 +0000 (11:08 +0100)]
avfilter/vf_vectorscope: use enum for graticule items

4 years agoavfilter/vf_geq: Add support for reading sample sums and means of rectangles
Michael Niedermayer [Fri, 6 Dec 2019 12:49:15 +0000 (13:49 +0100)]
avfilter/vf_geq: Add support for reading sample sums and means of rectangles

This allows integrating box blur style filters in geq.

Without this computing the mean of an area in geq would have been excessivly slow

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_geq: Add NB_PLANES
Michael Niedermayer [Fri, 6 Dec 2019 12:11:59 +0000 (13:11 +0100)]
avfilter/vf_geq: Add NB_PLANES

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavutil/eval: Add av_expr_count_func() similar to av_expr_count_vars()
Michael Niedermayer [Fri, 6 Dec 2019 16:18:16 +0000 (17:18 +0100)]
avutil/eval: Add av_expr_count_func() similar to av_expr_count_vars()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/vc1dec: Fix "return -1" cases
Michael Niedermayer [Mon, 16 Dec 2019 23:04:23 +0000 (00:04 +0100)]
avcodec/vc1dec: Fix "return -1" cases

Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/vc1dec: Free sprite_output_frame on error
Michael Niedermayer [Mon, 16 Dec 2019 22:31:22 +0000 (23:31 +0100)]
avcodec/vc1dec: Free sprite_output_frame on error

Fixes: memleaks
Fixes: 19471/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5688035714269184
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_geq: Relicense to LGPL
Michael Niedermayer [Mon, 16 Dec 2019 22:17:11 +0000 (23:17 +0100)]
avfilter/vf_geq: Relicense to LGPL

All authors who have code in this under GPL agreed.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/atrac9dec: Clamp band_ext_data to max that can be read if skipped.
Michael Niedermayer [Mon, 16 Dec 2019 23:19:42 +0000 (00:19 +0100)]
avcodec/atrac9dec: Clamp band_ext_data to max that can be read if skipped.

Fixes: out of array read
Fixes: 19327/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC9_fuzzer-5679823087468544
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/agm: Include block size in the MV check for flags == 3
Michael Niedermayer [Mon, 16 Dec 2019 22:09:04 +0000 (23:09 +0100)]
avcodec/agm: Include block size in the MV check for flags == 3

Fixes: out of array read
Fixes: 19331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5644115983466496
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/wmadec: Keep track of exponent initialization per channel
Michael Niedermayer [Sat, 30 Nov 2019 15:46:46 +0000 (16:46 +0100)]
avcodec/wmadec: Keep track of exponent initialization per channel

Fixes: division by 0
Fixes: 19123/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAV2_fuzzer-5655493121146880
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/iff: Check that video_size is large enough for the read parameters
Michael Niedermayer [Sat, 30 Nov 2019 11:22:25 +0000 (12:22 +0100)]
avcodec/iff: Check that video_size is large enough for the read parameters

video is allocated before parameters like bpp are read.

Fixes: out of array access
Fixes: 19084/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5718556033679360
Fixes: 19465/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5759908398235648
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/v4l2_m2m_enc: Check encoder pix_fmt matches pix_fmt on device
Andriy Gelman [Fri, 27 Dec 2019 23:38:35 +0000 (18:38 -0500)]
avcodec/v4l2_m2m_enc: Check encoder pix_fmt matches pix_fmt on device

Fixes #8079

During initialization of a v4l2m2m device, the configured pix_fmt can be
different to the pix_fmt of the encoder (i.e. avctx->pix_fmt).

For example on the Odroid XU4:
./ffmpeg -f lavfi -i yuvtestsrc -codec:v h264_v4l2m2m out.h264

will configure the v4l2 encoder to pix_fmt nv21, whereas the input
frames will be yuv444p.

This commit checks that the configured v4l2 pix_fmt on device is the
same as avctx->pix_fmt. If they are different the initialization fails
and an error is returned. Tested on RPI4 and Odroid XU4.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoavutil/tests/opt: add av_opt_get/av_opt_set tests
Marton Balint [Wed, 25 Dec 2019 20:07:41 +0000 (21:07 +0100)]
avutil/tests/opt: add av_opt_get/av_opt_set tests

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavutil/tests/opt: add tests for AV_OPT_TYPE_DICT
Marton Balint [Wed, 25 Dec 2019 18:35:34 +0000 (19:35 +0100)]
avutil/tests/opt: add tests for AV_OPT_TYPE_DICT

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavutil/opt: add full support for AV_OPT_TYPE_DICT
Marton Balint [Mon, 23 Dec 2019 23:19:47 +0000 (00:19 +0100)]
avutil/opt: add full support for AV_OPT_TYPE_DICT

Now it is possible to set them from a string, to serialize them and to use a
default value.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavfilter/vf_vibrance: add support for commands
Paul B Mahol [Fri, 27 Dec 2019 20:31:04 +0000 (21:31 +0100)]
avfilter/vf_vibrance: add support for commands

4 years agoavfilter/vf_il: add support for commands
Paul B Mahol [Fri, 27 Dec 2019 20:17:00 +0000 (21:17 +0100)]
avfilter/vf_il: add support for commands

4 years agoavfilter/af_stereowiden: add support for commands
Paul B Mahol [Fri, 27 Dec 2019 20:03:29 +0000 (21:03 +0100)]
avfilter/af_stereowiden: add support for commands

4 years agoavfilter/af_extrastereo: add support for commands
Paul B Mahol [Fri, 27 Dec 2019 19:57:06 +0000 (20:57 +0100)]
avfilter/af_extrastereo: add support for commands

4 years agoavfilter/vf_neighbor: add support for commands
Paul B Mahol [Fri, 27 Dec 2019 19:21:20 +0000 (20:21 +0100)]
avfilter/vf_neighbor: add support for commands

4 years agoavformat/dashdec: propagate icy to child AVIOContexts
Marvin Scholz [Tue, 17 Dec 2019 00:45:04 +0000 (01:45 +0100)]
avformat/dashdec: propagate icy to child AVIOContexts

When the user decides they do not want to to send the Icy-MetaData
header, this should be respected for all requests, not just the first
one.

Fix #5578

Reviewed-by: Liu Steven <lq@chinaffmpeg.org>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/hls: propagate icy to child AVIOContexts
Marvin Scholz [Tue, 17 Dec 2019 00:17:42 +0000 (01:17 +0100)]
avformat/hls: propagate icy to child AVIOContexts

When the user decides they do not want to to send the Icy-MetaData
header, this should be respected for all requests, not just the first
one.

Fix #5578

Reviewed-by: Liu Steven <lq@chinaffmpeg.org>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/mvha: fix warning: variable 'size' set but not used
Limin Wang [Fri, 27 Dec 2019 15:58:35 +0000 (23:58 +0800)]
avcodec/mvha: fix warning: variable 'size' set but not used

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/microdvdenc: Use avio_w8 to write a char
Andreas Rheinhardt [Thu, 12 Dec 2019 15:53:18 +0000 (16:53 +0100)]
avformat/microdvdenc: Use avio_w8 to write a char

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/microdvd: Use \n instead of \0 to end file header
Andreas Rheinhardt [Thu, 12 Dec 2019 15:53:17 +0000 (16:53 +0100)]
avformat/microdvd: Use \n instead of \0 to end file header

Up until now, the microdvd demuxer uses av_strdup() to allocate the
extradata from a string; its length is set to strlen() + 1, i.e.
including the \0 at the end. Upon remuxing, the muxer would simply copy
the extradata at the beginning, including the \0.

This commit changes this by not adding the \0 to the size of the
extradata; the muxer now delimits extradata by inserting a \n. This
required to change the subtitles-microdvd-remux FATE-test.

Furthermore, the extradata is now allocated with zeroed padding.

The microdvd decoder is not affected by this, as it didn't use the size
of the extradata at all, but treated it as a C-string.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/flvenc: Fix leak of oversized packets
Andreas Rheinhardt [Thu, 26 Dec 2019 10:53:35 +0000 (11:53 +0100)]
avformat/flvenc: Fix leak of oversized packets

Might happen for annex B H.264.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/flvenc: Forward errors from allocating keyframe index
Andreas Rheinhardt [Thu, 26 Dec 2019 10:53:34 +0000 (11:53 +0100)]
avformat/flvenc: Forward errors from allocating keyframe index

While the function adding a new element to the keyframe index checked
the allocation, the caller didn't check the return value. This has been
changed. To do so, the return value has been changed to an ordinary ret
instead of pb->error. This doesn't pose a problem, as write_packet() in
mux.c already checks for write errors (since 9ad1e0c1).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/wavenc: Add deinit function
Andreas Rheinhardt [Thu, 26 Dec 2019 10:53:27 +0000 (11:53 +0100)]
avformat/wavenc: Add deinit function

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/spdifenc: Replace write_trailer by deinit
Andreas Rheinhardt [Thu, 26 Dec 2019 10:53:26 +0000 (11:53 +0100)]
avformat/spdifenc: Replace write_trailer by deinit

The write_trailer function doesn't write anything anyway. It only frees
memory.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/vc1dec: remove the unneeded ()
Limin Wang [Thu, 26 Dec 2019 01:31:04 +0000 (09:31 +0800)]
avcodec/vc1dec: remove the unneeded ()

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/ass: remove the unneeded ()
Limin Wang [Thu, 26 Dec 2019 01:31:03 +0000 (09:31 +0800)]
avcodec/ass: remove the unneeded ()

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_histogram: use the name 's' for the pointer to the private context
Paul B Mahol [Thu, 26 Dec 2019 19:45:20 +0000 (20:45 +0100)]
avfilter/vf_histogram: use the name 's' for the pointer to the private context

This is consistent across filters.

4 years agoavcodec/cbs_vp9: Check data_size
Michael Niedermayer [Wed, 25 Dec 2019 23:57:07 +0000 (00:57 +0100)]
avcodec/cbs_vp9: Check data_size

Fixes: out of array access
Fixes: 19542/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5659498341728256
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/buffersrc: Remove unused variables
Andreas Rheinhardt [Wed, 25 Dec 2019 11:59:07 +0000 (12:59 +0100)]
avfilter/buffersrc: Remove unused variables

Unused since f09ae730.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavdevice/xcbgrab: use a buffer pool for shared memory segments
Marton Balint [Sat, 7 Dec 2019 19:41:44 +0000 (20:41 +0100)]
avdevice/xcbgrab: use a buffer pool for shared memory segments

Also by wrapping the SHM buffer in an AVBufferRef we eliminate yet another
possible memcpy improving performance.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavutil/buffer: add av_buffer_pool_buffer_get_opaque
Marton Balint [Sat, 7 Dec 2019 00:56:56 +0000 (01:56 +0100)]
avutil/buffer: add av_buffer_pool_buffer_get_opaque

In order to access the original opaque parameter of a buffer in the buffer
pool. (The buffer pool implementation overrides the normal opaque parameter but
also saves it so it is accessible).

v2: add assertion check before dereferencing the BufferPoolEntry.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/dhav: improve seeking
Paul B Mahol [Wed, 25 Dec 2019 18:35:27 +0000 (19:35 +0100)]
avformat/dhav: improve seeking

4 years agoavcodec/cbs_vp9: Check index_size
Michael Niedermayer [Fri, 13 Dec 2019 23:27:09 +0000 (00:27 +0100)]
avcodec/cbs_vp9: Check index_size

Fixes: out of array read
Fixes: 19300/clusterfuzz-testcase-minimized-ffmpeg_BSF_VP9_METADATA_fuzzer-5653911730126848
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_yadif: cosmetics in the pix_fmts[] array
Limin Wang [Thu, 28 Nov 2019 01:34:17 +0000 (09:34 +0800)]
avfilter/vf_yadif: cosmetics in the pix_fmts[] array

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/drawtext: log why input pad failed to be configured
Gyan Doshi [Mon, 23 Dec 2019 16:10:02 +0000 (21:40 +0530)]
avfilter/drawtext: log why input pad failed to be configured

4 years agoavformat/sccdec: only change duration for last subtitle
Paul B Mahol [Mon, 23 Dec 2019 21:47:27 +0000 (22:47 +0100)]
avformat/sccdec: only change duration for last subtitle

4 years agoavformat/sccdec: fix sub->pos values
Paul B Mahol [Mon, 23 Dec 2019 21:39:46 +0000 (22:39 +0100)]
avformat/sccdec: fix sub->pos values

4 years agoavformat/sccdec: fix timestamp of last subtitle
Paul B Mahol [Mon, 23 Dec 2019 21:15:23 +0000 (22:15 +0100)]
avformat/sccdec: fix timestamp of last subtitle

Fixes -c:s copy case.

4 years agoavfilter/vf_fade: reindent after previous commit
Paul B Mahol [Mon, 23 Dec 2019 19:24:36 +0000 (20:24 +0100)]
avfilter/vf_fade: reindent after previous commit

4 years agoavfilter/vf_fade: add support for gbrp/gbrap formats
Paul B Mahol [Tue, 19 Nov 2019 13:09:42 +0000 (14:09 +0100)]
avfilter/vf_fade: add support for gbrp/gbrap formats

4 years agolavc/midivid: check return value of init_get_bits8()
Zhong Li [Mon, 23 Dec 2019 14:14:09 +0000 (14:14 +0000)]
lavc/midivid: check return value of init_get_bits8()

Fix CID 1456088

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agoavfilter/vf_readeia608: factor some constants out
Paul B Mahol [Mon, 23 Dec 2019 19:07:49 +0000 (20:07 +0100)]
avfilter/vf_readeia608: factor some constants out

4 years agoavfilter/vf_readeia608: check if gaps between clock bits are big enough
Paul B Mahol [Mon, 23 Dec 2019 18:56:05 +0000 (19:56 +0100)]
avfilter/vf_readeia608: check if gaps between clock bits are big enough

Should help finding less false positives.

4 years agoavfilter/vf_readeia608: use special struct to hold line items
Paul B Mahol [Mon, 23 Dec 2019 11:28:30 +0000 (12:28 +0100)]
avfilter/vf_readeia608: use special struct to hold line items

4 years agoavfilter/avfilter: update documentation of avfilter_graph_create_filter
Zhao Zhili [Fri, 6 Dec 2019 07:06:18 +0000 (15:06 +0800)]
avfilter/avfilter: update documentation of avfilter_graph_create_filter

4 years agoavfilter/buffersink: deprecate AVBufferSinkParams and AVABufferSinkParams
Zhao Zhili [Fri, 6 Dec 2019 07:06:17 +0000 (15:06 +0800)]
avfilter/buffersink: deprecate AVBufferSinkParams and AVABufferSinkParams

4 years agoavfilter/buffersink: replace init_opaque by init
Zhao Zhili [Fri, 6 Dec 2019 07:06:16 +0000 (15:06 +0800)]
avfilter/buffersink: replace init_opaque by init

The argument 'opaque' is always NULL since 0acf7e2 (2013),
and avfilter_init_filter() was removed in 52067b3c0e (2016).

4 years agoavfilter/buffersink: remove unused macros
Zhao Zhili [Fri, 6 Dec 2019 07:06:15 +0000 (15:06 +0800)]
avfilter/buffersink: remove unused macros

4 years agoavfilter/buffersrc: remove redundant flag
Zhao Zhili [Wed, 4 Dec 2019 13:41:07 +0000 (21:41 +0800)]
avfilter/buffersrc: remove redundant flag

!(c->pix_fmt != AV_PIX_FMT_NONE || c->got_format_from_params)

equals

(c->pix_fmt == AV_PIX_FMT_NONE) && !c->got_format_from_params

1. When (c->pix_fmt == AV_PIX_FMT_NONE) is true, got_format_from_params is
always false, the flag doesn't contribute to the result.

2. When the first part is false, the second part doesn't matter, the flag
doesn't contribute to the result.

The result only depends on c->pix_fmt.

4 years agoavformat/mpegtsenc: warn users if codec isn't supported
Gyan Doshi [Fri, 20 Dec 2019 11:09:32 +0000 (16:39 +0530)]
avformat/mpegtsenc: warn users if codec isn't supported

The MPEG-TS muxer will mux streams with unsupported codec id
as a private data stream; this usually makes the stream
not recognizable by ffmpeg and likely other tools.

4 years agoavcodec/noise_bsf: remove superfluous fail label
James Almer [Mon, 23 Dec 2019 14:43:57 +0000 (11:43 -0300)]
avcodec/noise_bsf: remove superfluous fail label

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoChangelog: Fix typo of comments
Steven Liu [Sat, 21 Dec 2019 06:32:21 +0000 (14:32 +0800)]
Changelog: Fix typo of comments

Signed-off-by: Steven Liu <lq@onvideo.cn>
Reviewed-by: Lou Logan <lou@lrcd.com>
4 years agolavfi/buffersrc: push frame directly.
Nicolas George [Mon, 2 Dec 2019 16:01:50 +0000 (17:01 +0100)]
lavfi/buffersrc: push frame directly.

This allows to remove the queued frame entirely.

4 years agolavfi: remove AVFilterPad.poll_frame().
Nicolas George [Mon, 2 Dec 2019 15:46:11 +0000 (16:46 +0100)]
lavfi: remove AVFilterPad.poll_frame().

This design is no longer used and was replaced a long time ago.

4 years agolavfi/buffersrc: remove poll_frame.
Nicolas George [Mon, 2 Dec 2019 15:42:59 +0000 (16:42 +0100)]
lavfi/buffersrc: remove poll_frame.

4 years agolavfi: remove ff_poll_frame().
Nicolas George [Mon, 2 Dec 2019 15:41:07 +0000 (16:41 +0100)]
lavfi: remove ff_poll_frame().

It is never used.

4 years agolavfi/buffersrc: remove fifo.
Nicolas George [Mon, 2 Dec 2019 15:38:19 +0000 (16:38 +0100)]
lavfi/buffersrc: remove fifo.

The frame is immediately pushed, the fifo has never more than one.

4 years agoavfilter/vf_readeia608: fix check for failed av_calloc
Limin Wang [Mon, 23 Dec 2019 04:55:58 +0000 (12:55 +0800)]
avfilter/vf_readeia608: fix check for failed av_calloc

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/hls: Use av_packet_move_ref() for packet ownership transfer
Andreas Rheinhardt [Tue, 3 Dec 2019 10:27:38 +0000 (11:27 +0100)]
avformat/hls: Use av_packet_move_ref() for packet ownership transfer

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/hlsenc: Fix check for presence of webvtt muxer
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:15 +0000 (01:04 +0100)]
avformat/hlsenc: Fix check for presence of webvtt muxer

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix memleaks with repeating parameters
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:13 +0000 (01:04 +0100)]
avformat/hlsenc: Fix memleaks with repeating parameters

When a parameter like e.g. language is contained more than once in the
part of var_stream_map pertaining to a single VariantStream, the later
one just overwrites the pointer to the earlier one, leading to a
memleak. This commit changes this by handling the situation gracefully:
The earlier string is silently freed first, so that the last one wins.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix return value from localtime_r failure
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:12 +0000 (01:04 +0100)]
avformat/hlsenc: Fix return value from localtime_r failure

"If an error is detected, localtime_r() shall return a null pointer
and set errno to indicate the error." Yet in case this happened in
hls_init(), AVERROR(ENOMEM) has been returned.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix potential segfault upon allocation failure
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:09 +0000 (01:04 +0100)]
avformat/hlsenc: Fix potential segfault upon allocation failure

The hls muxer allocates an array of VariantStreams, a structure that
contains pointers to objects that need to be freed on their own. This
means that the number of allocated VariantStreams needs to be correct
when they are freed; yet the number of VariantStreams is set in
update_variant_stream_info() resp. parse_variant_stream_mapstring()
before the allocation has been checked for success, so that upon error
an attempt would be made to free the objects whose pointers are
positioned at position NULL (the location of VariantStreams) +
offsetof(VariantStream, the corresponding pointer).

Furthermore d1fe1344 added another possibility for the first function
to leave an inconsistent state behind: If an allocation of one of the
objects referenced by the VariantStream fails, the VariantStream will be
freed, but the number of allocated VariantStreams isn't reset, leading
to the same problem as above. (This was done in the mistaken belief that
the VariantStreams array would leak otherwise.)

Essentially the same also happens for the number of cc-streams. It has
been fixed, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix leak of options when writing packets
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:07 +0000 (01:04 +0100)]
avformat/hlsenc: Fix leak of options when writing packets

Under certain circumstances hls_write_packet() would add options to an
AVDictionary. Said dictionary was never explicitly freed, instead it was
presumed that these options would be consumed when opening a new
IO-context. This left several possibilities for memleaks:

a) When no new IO-context would be opened at all. This is possible when
using both the flags temp_file and single_file together with a file
output.
b) When an error happens before one actually tries to open the new
IO-context.
c) When the new IO-context does not consume all options.

All three have been fixed; furthermore, the AVDictionary has been put
into a smaller scope (namely the only part of hls_write_packet() where
it is actually used).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix leak of options when initializing muxing fails
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:06 +0000 (01:04 +0100)]
avformat/hlsenc: Fix leak of options when initializing muxing fails

hls_mux_init() currently leaks an AVDictionary if opening a dynamic
buffer fails or if avformat_init_output fails. This has been fixed by
moving the initialization resp. the freeing of the dictionary around:
In the former case to a place after opening the dynamic buffer, in the
latter to a place before the check for initialization failure so that it
is done unconditionally.

Furthermore, the dictionary is now only copied and freed if the options
in it are actually used (namely when in SEGMENT_TYPE_FMP4 mode).

Finally, a similar situation in hls_start() has been fixed, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Only allocate when data is known to be needed
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:05 +0000 (01:04 +0100)]
avformat/hlsenc: Only allocate when data is known to be needed

hls_init() would allocate a buffer, although it is only needed in one of
two branches that follow. This commit moves the allocation to the branch
that actually needs the buffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix typo in error message
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:04 +0000 (01:04 +0100)]
avformat/hlsenc: Fix typo in error message

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agoavformat/hlsenc: Fix leak of child AVFormatContext
Andreas Rheinhardt [Mon, 16 Dec 2019 00:04:03 +0000 (01:04 +0100)]
avformat/hlsenc: Fix leak of child AVFormatContext

Before ed897633, the hls muxer would free its child AVFormatContexts
and reset the pointer to these contexts to NULL immediately afterwards;
ed897633 moved the former to later (into a separate function), but kept
the resetting, ensuring that the child context leaks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
4 years agofftools/cmdutils: Fix break command dump for -map option
Jun Zhao [Thu, 12 Dec 2019 08:02:53 +0000 (16:02 +0800)]
fftools/cmdutils: Fix break command dump for -map option

Before this fix, ffmpeg -h full | grep map get the command dump
like:

-map [-]input_file_id[:stream_specifier][,sync_file_id[:stream_s  set input stream mapping
                                                               ^
                                                               |
    truncated
after this fix, we can get full option dump.

Found-by: vacingfang <vacingfang@tencent.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavcodec/hevcdec: keep closed captions in sync between multiple thread contexts
James Almer [Fri, 20 Dec 2019 17:05:42 +0000 (14:05 -0300)]
avcodec/hevcdec: keep closed captions in sync between multiple thread contexts

Based on h264 code.

Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/af_adeclick: implement timeline support
Paul B Mahol [Sat, 21 Dec 2019 19:02:04 +0000 (20:02 +0100)]
avfilter/af_adeclick: implement timeline support

4 years agoavformat/movenc: use iso6 major brand when signed CTS offsets are used in trun boxes
James Almer [Sun, 1 Dec 2019 16:11:28 +0000 (13:11 -0300)]
avformat/movenc: use iso6 major brand when signed CTS offsets are used in trun boxes

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/movenc: ensure we don't write the major brand as a compatible brand more...
James Almer [Sun, 1 Dec 2019 16:10:48 +0000 (13:10 -0300)]
avformat/movenc: ensure we don't write the major brand as a compatible brand more than once

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/movenc: write the major brand also as the first compatible brand
James Almer [Wed, 27 Nov 2019 17:15:34 +0000 (14:15 -0300)]
avformat/movenc: write the major brand also as the first compatible brand

Signed-off-by: James Almer <jamrial@gmail.com>