1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

97112 Commits

Author SHA1 Message Date
Andreas Rheinhardt
42b000427d avformat/webm_chunk: Add init function
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-26 02:25:14 +01:00
Andreas Rheinhardt
73a595b8e8 avformat/webm_chunk: Remove unnecessary variable
chunk_start_index (which was set via an option) was only used to
initialize chunk_index and otherwise unused. So initialize chunk_index
directly via the option and remove chunk_start_index.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-26 02:22:46 +01:00
Andreas Rheinhardt
8a632b3e2e avformat/webm_chunk: Don't copy header filename
Instead just reuse the filename string that is given via an option
for the child muxer's url field.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-26 02:17:40 +01:00
Andreas Rheinhardt
f397dc3378 avformat/webm_chunk: Don't keep pointer to AVOutputFormat
It is no longer needed given that the function pointers of the child
muxer's AVOutputFormat are no longer called directly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-26 02:12:10 +01:00
Andreas Rheinhardt
3d4dd9195f avformat/webm_chunk: Avoid unnecessary flushes
The webm_chunk muxer caches its output to a dynamic buffer and when it
outputs anything, it explicitly flushes it. So set the flags indicating
that flushing after each packet should not be done automatically
(basically avoiding avio_write_marker() to be called by flush_if_needed()
in libavformat/mux.c).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-26 02:08:17 +01:00
Andreas Rheinhardt
e70c2d02fc avformat/webm_chunk: Use API functions for child muxer
instead of calling the write_header/packet/trailer functions directly
via the function pointers. Also, use distinct AVStreams for the child
AVFormatContext (up until now the two AVFormatContexts shared their
AVStreams because allocating their own was deemed too onerous).

Using the function pointers directly meant that the Matroska muxer's
init-function was never called, because init-functions were only
introduced a few months after webm_chunk has been added and no one
thought of/bothered to adapt webm_chunk for this (when the init-function
was added in b287d7ea, the code setting the timebase was moved to it,
so that the timebases were no longer set to ms-precision when using
the webm_chunk muxer; this has been fixed after some time in 42a635dd
by setting the timebases direcly (instead of calling the init-function)).

And when 982a98a0 added a deinit-function for the Matroska muxer, it
introduced memleaks in webm_chunk, because the child muxer's internal
structures were no longer freed when calling write_trailer directly.
(Given that the init function has never ever been called, the child
muxer has never ever been properly initialized, so that the
deinit-function was not called when freeing the child context.)

This commit stops calling the function pointers directly and instead
uses the standard API functions for muxers. This fixes the above
mentioned memleaks. (Memleaks are still possible on error. This will be
fixed in a future commit that adds a deinit-function to webm_chunk
itself.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-26 01:54:56 +01:00
Andreas Rheinhardt
a9004ffe0f avformat/webm_chunk: Use appropriate initializer for AV_OPT_TYPE_STRING
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-26 01:54:06 +01:00
Andreas Rheinhardt
b1b847ba56 avformat/webm_chunk: Copy more information to the child AVFormatContext
In particular the flags are important so that AVFMT_FLAG_BITEXACT can be
honoured by the child muxer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-26 01:52:10 +01:00
Andreas Rheinhardt
2a78968849 avformat/webm_chunk: Close IO if writing header fails
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-26 01:49:34 +01:00
Andreas Rheinhardt
0b1af9d330 avformat/webm_chunk: Don't use child AVFormatContext for logging
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-26 01:44:06 +01:00
Andreas Rheinhardt
00d0934fce avformat/webmdashenc: Don't use custom option for bitexactness
The WebM DASH Manifest muxer can write manifests for live streams and
these contain an entry that depends on the time the manifest is written;
an AVOption to make the output reproducible has been added for tests.
But this is unnecessary, as there already is a method for reproducible
output: The AVFMT_FLAG_BITEXACT-flag of the AVFormatContext. Therefore
this commit removes the custom option.

Given that the description of said option contained "private option -
users should never set this" and that it was not documented in
muxers.texi, no deprecation period for this option seemed necessary.

The commands of the FATE-tests for this muxer have been changed to no
longer use this option.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-25 23:26:29 +01:00
Steve Lhomme
a95351ea50 avformat/matroska: add missing Buttons track type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-25 22:24:05 +01:00
Limin Wang
157873623f avcodec/dvbsubdec: replace data_size with got_sub_ptr for better readability
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-25 18:41:21 +01:00
Limin Wang
8ea4efffdb avcodec/libzvbi-teletextdec: replace data_size with got_sub_ptr for better readability
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-25 18:41:21 +01:00
Limin Wang
766888e519 avcodec/pgssubdec: replace data_size with got_sub_ptr for better readability
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-25 18:41:21 +01:00
Limin Wang
2d244c9a00 avcodec/xsubdec: replace data_size with got_sub_ptr for better readability
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-25 18:41:21 +01:00
Paul B Mahol
0b43897530 avfilter/vf_v360: fix hfov/vfov calculation from dfov for sg projection 2020-03-25 13:38:41 +01:00
Andreas Rheinhardt
e5d25d1147 avcodec/hevc: Cosmetics: Realign after last commit
Suggested-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-24 23:47:00 +01:00
Andreas Rheinhardt
7272d0c0a9 avcodec/hevc, h2645_parse: Fix HEVC NAL unit names and constants
This commit fixes the names and constants of the reserved NAL units
with nal_unit_type 22 resp. 23. They were "IRAP_IRAP_VLC2x", but are
actually "RSV_IRAP_VLC2x".

This also required a change to cbs_h265_syntax_template.c.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-24 23:33:24 +01:00
Andreas Rheinhardt
557668e8cb avformat/dss: Use AV_DICT_DONT_STRDUP_VAL to save a malloc+memcpy
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-24 23:02:30 +01:00
Andreas Rheinhardt
3ab16d091e avcodec/dfa: Use array of fixed-sized strings for fixed-sized strings
Surprisingly neither GCC nor Clang did this transformation on their own.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-24 22:02:13 +01:00
Andreas Rheinhardt
9dfc409e6b avformat/hls: Don't strdup non-null-terminated string
If an URI indicated that the data protocol was in use, it would be
copied into a temporary buffer via strncpy(dst, src, strlen(src)),
thereby ensuring that the trailing \0 would not be copied, despite dst
being uninitialized. dst would then be av_strdup'ed, leading to
potential segfaults.

The solution to this is simple: Don't copy the URI in the temporary
buffer at all, instead av_strdup it directly.

This fixes a -Wstringop-truncation warning emitted by GCC 9.2.

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-24 21:22:15 +01:00
Andreas Rheinhardt
65e8f6dd9b avfilter/vf_paletteuse: Forward error codes
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-24 20:14:08 +01:00
Gyan Doshi
7239254b1d avfilter/hue: fix range in comment
Found-by: Michael Koch
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
2020-03-24 15:04:52 +05:30
Ramiro Polla
ba698a23c6 MAINTAINERS: add my gpg fingerprint
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-23 23:37:19 +01:00
Limin Wang
750a81ba99 avformat/mxfdec: use av_asprintf()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-23 23:37:19 +01:00
Lynne
2465fe1302 lavu/tx: add 2-point FFT transform
By itself, this allows 6-point, 10-point and 30-point transforms.
When the 9-point transform is added it allows for 18-point FFT,
and also for a 36-point MDCT (used by MP3).
2020-03-23 21:26:25 +00:00
Lynne
9f494d1397 lavu/tx: improve documentation 2020-03-23 21:26:25 +00:00
Ramiro Polla
c455a28a9e avcodec/wmadec: cosmetics
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-03-22 11:55:44 -03:00
Ramiro Polla
c2b540d0c7 avcodec/get_bits: cosmetics
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-03-22 11:55:44 -03:00
Limin Wang
a289cc5643 avcodec/decode: increase nb_bsfs after av_bsf_alloc in case alloc failed
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-22 13:00:19 +01:00
Andreas Rheinhardt
9e0f3352d1 avformat/hnm: Check for extradata allocation failure
and also add padding to it; moreover, don't use memcpy to write one byte
to extradata.

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>
2020-03-22 13:00:19 +01:00
Andreas Rheinhardt
6bd8bcc2ac avformat/subtitles: Don't increment packet counter prematurely
Do it only if the packet has been successfully allocated in
av_new_packet() -- otherwise on error a completely uninitialized packet
would be unreferenced later.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-22 13:00:19 +01:00
Andreas Rheinhardt
5acef12061 avformat/bethsoftvid: Fix potential memleak upon reallocation failure
The classical ptr = av_realloc(ptr, size), just with av_fast_realloc().

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>
2020-03-22 13:00:19 +01:00
Andreas Rheinhardt
6e14ddd156 avformat/bethsoftvid: Avoid allocations and frees for palettes
by putting the palette in the demuxer's context. This also allows to
remove this demuxer's read_close-function.

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>
2020-03-22 13:00:19 +01:00
Andreas Rheinhardt
ea46b45e9c avcodec/bsf: Beautify log messages from bitstream filters
Up until now, the name of every AVBSFContext for logging purposes was
"AVBSFContext", so that the default logging callback produced output
like "[AVBSFContext @ 0x55813bae92c0] Extradata". This has been changed
to "[trace_headers @ 0x60a000000700] Extradata" by adding an item_name-
function to the AVClass for bitstream filters.

Furthermore, the correct category has been set so that the introductory
part before the actual message (everything before "Extradata" in the
above examples) are displayed in a different colour than the rest.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-03-21 18:52:45 -03:00
Andreas Rheinhardt
d0ba6715d2 avcodec/bsf: Don't set defaults for AVClass without options
This happened for AVBSFContext.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-03-21 18:52:10 -03:00
Michael Niedermayer
c8140fe732 avformat/asfdec_f: Fix overflow check in get_tag()
Fixes: signed integer overflow: 2 * 1210064928 cannot be represented in type 'int'
Fixes: 20873/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5761116909338624

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-21 20:55:27 +01:00
Carl Eugen Hoyos
559ce9c845 lavf/subviewerdec: Support higher sub-second precision.
Fixes ticket #8575.
2020-03-21 18:46:36 +01:00
Carl Eugen Hoyos
0123a0fd14 common.mak: Also clean Windows debug files. 2020-03-21 18:46:00 +01:00
Paul B Mahol
f39678b3a9 avformat/bink: properly mark packets that are key frames 2020-03-20 14:24:34 +01:00
Anton Khirnov
6eae7e5644 h264dec: do not export the chroma sample location immediately on parsing the SPS
This SPS is not necessarily the one that will be used. Export the chroma
location along with all the other SPS properties.
2020-03-20 09:16:05 +01:00
Anton Khirnov
bdd31feec9 sbcdec: do not unnecessarily set frame properties
Decoders are supposed to export stream properties in AVCodecContext, the
AVFrame properties are set from those in ff_get_buffer().
2020-03-20 09:16:05 +01:00
Nicolas Gaullier
1ec86be79b avcodec/mpeg12dec: Add CPB coded side data
This fixes mpeg2video stream copies to mpeg muxer like this:
  ffmpeg -i xdcamhd.mxf -c:v copy output.mpg

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-20 09:16:05 +01:00
Nicolas Gaullier
42271f8e18 avcodec/utils: Fix ff_add_cpb_side_data() add twice
Makes it behave similarly to av_stream_add_side_data().

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-20 09:16:05 +01:00
Nicolas Gaullier
2d6baff0c0 avformat/utils: Make find_stream_info get side data from codec context
This will allow probing input coded side data, and also forwarding them to the output.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-20 09:16:05 +01:00
Nicolas Gaullier
eb88ccb92e avcodec/mpeg12dec: Do not alter avctx->rc_buffer_size
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-20 09:16:05 +01:00
Daniel Playfair Cal
fa41be5743 hwcontext_opencl: include header file in HEADERS
This matches the inclusion of the other hwcontext_<hwaccel>.h headers.
The skipping of the header depending on build flags is already present.

Signed-off-by: Daniel Playfair Cal: <daniel.playfair.cal@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-03-20 09:16:05 +01:00
Andreas Rheinhardt
d9f38b99dd fftools/ffmpeg_opt: Fix [u]int64_t specifier string
PRId64 and PRIu64 already expand to the complete specifier; adding
another 'd' at the end is wrong and just leads to warnings that say
that only an option like '-frames:v 2d' will be used, although said
option won't be accepted at all ('Expected int64 for frames:v but found
2d').

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-03-19 20:06:12 +01:00
Andriy Gelman
140ce8ada6 doc/general: Fix entry for AMQP
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-03-19 20:06:03 +01:00