ffmpeg.git
2 years agoavformat/matroskaenc: Redo handling of FlagDefault
Andreas Rheinhardt [Sat, 18 Jan 2020 06:05:20 +0000 (07:05 +0100)]
avformat/matroskaenc: Redo handling of FlagDefault

Up until now, the Matroska muxer would mark a track as default if it had
the disposition AV_DISPOSITION_DEFAULT or if there was no track with
AV_DISPOSITION_DEFAULT set; in the latter case even more than one track
of a kind (audio, video, subtitles) was marked as default which is not
sensible.

This commit changes the logic used to mark tracks as default. There are
now three modes for this:
a) In the "infer" mode the first track of every type (audio, video,
subtitles) with default disposition set will be marked as default; if
there is no such track (for a given type), then the first track of this
type (if existing) will be marked as default. This behaviour is inspired
by mkvmerge. It ensures that the default flags will be set in a sensible
way even if the input comes from containers that lack the concept of
default flags. This mode is the default mode.
b) The "infer_no_subs" mode is similar to the "infer" mode; the
difference is that if no subtitle track with default disposition exists,
no subtitle track will be marked as default at all.
c) The "passthrough" mode: Here the track will be marked as default if
and only the corresponding input stream had disposition default.

This fixes ticket #8173 (the passthrough mode is ideal for this) as
well as ticket #8416 (the "infer_no_subs" mode leads to the desired
output).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Don't needlessly copy AVCodecParameters
Andreas Rheinhardt [Wed, 22 Jan 2020 19:03:15 +0000 (20:03 +0100)]
avformat/matroskaenc: Don't needlessly copy AVCodecParameters

At the end of encoding, the FLAC encoder sends a packet whose side data
contains updated extradata (e.g. a correct md5 checksum). The Matroska
muxer uses this to update the CodecPrivate.

In doing so, the stream's codecpar was copied. But given that writing
a FLAC CodecPrivate does not modify the used AVCodecParameters at all,
there is no need to do so and this commit changes this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Add const where appropriate
Andreas Rheinhardt [Wed, 20 Nov 2019 02:35:24 +0000 (03:35 +0100)]
avformat/matroskaenc: Add const where appropriate

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Don't waste bytes on length fields
Andreas Rheinhardt [Sun, 29 Dec 2019 09:22:49 +0000 (10:22 +0100)]
avformat/matroskaenc: Don't waste bytes on length fields

Several EBML Master elements for which a good upper bound of the final
length was available were nevertheless written without giving an
upper bound of the final length to start_ebml_master(), so that their
length fields were eight bytes long. This has been changed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Only write Tracks if there is a track
Andreas Rheinhardt [Sun, 29 Dec 2019 02:26:05 +0000 (03:26 +0100)]
avformat/matroskaenc: Only write Tracks if there is a track

The Matroska muxer does not write every stream as a Matroska track;
some streams are written as AttachedFile. But should no stream be
written as a Matroska track, the Matroska muxer would nevertheless
write a Tracks element without a TrackEntry. This is against the spec.
This commit changes this and only writes a Tracks if there is a Matroska
track.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Warn that WebM doesn't support Attachments
Andreas Rheinhardt [Sat, 2 Nov 2019 17:56:31 +0000 (18:56 +0100)]
avformat/matroskaenc: Warn that WebM doesn't support Attachments

As WebM doesn't support Attachments, the Matroska muxer drops them when
in WebM mode. This happened silently until this commit which adds a
warning for this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Don't use size of inexistent Cluster
Andreas Rheinhardt [Wed, 22 Jan 2020 19:01:30 +0000 (20:01 +0100)]
avformat/matroskaenc: Don't use size of inexistent Cluster

In order to determine whether the current Cluster needs to be closed
because of the limits on clustersize and clustertime,
mkv_write_packet() would first get the size of the current Cluster by
applying avio_tell() on the dynamic buffer holding the current Cluster.
It did this without checking whether there is a dynamic buffer for
writing Clusters open right now.

In this case (which happens when writing the first packet)
avio_tell() returned AVERROR(EINVAL); yet it is not good to rely on
avio_tell() (or actually, avio_seek()) to handle the situation
gracefully.

Fixing this is easy: Only check whether a Cluster needs to be closed
if a Cluster is in fact open.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Add check for using explicit TrackNumber
Andreas Rheinhardt [Fri, 1 Nov 2019 10:49:47 +0000 (11:49 +0100)]
avformat/matroskaenc: Add check for using explicit TrackNumber

When creating DASH streams, the TrackNumber is externally prescribed
and not derived from the number of streams in the AVFormatContext, so
if the number of tracks for a file using an explicit TrackNumber was
more than one, the resulting file would be broken (it would be impossible
to tell to which track a Block belongs if different tracks share the
same TrackNumber). So disallow this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Improve Cues in case of no video
Andreas Rheinhardt [Sun, 29 Dec 2019 02:14:53 +0000 (03:14 +0100)]
avformat/matroskaenc: Improve Cues in case of no video

The Matroska muxer currently only adds CuePoints in three cases:
a) For video keyframes. b) For the first audio frame in a new Cluster if
in DASH-mode. c) For subtitles. This means that ordinary Matroska audio
files won't have any Cues which impedes seeking.

This commit changes this. For every track in a file without video track
it is checked and tracked whether a Cue entry has already been added
for said track for the current Cluster. This is used to add a Cue entry
for each first packet of each track in each Cluster.

Implements #3149.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Remove limit on the number of tracks
Andreas Rheinhardt [Wed, 15 Apr 2020 02:49:46 +0000 (04:49 +0200)]
avformat/matroskaenc: Remove limit on the number of tracks

The Matroska file format has practically no limit on the number of
tracks (the current limit is 2^56 - 1); yet because they are encoded in
a variable length format in (Simple)Blocks this muxer has simply imposed
a limit on the number of tracks in order to ensure that they can always
be written on one byte in order to simplify the muxing process.

This commit removes said limit.

Also, zero is an invalid TrackNumber, so disallow this value in the
dash_track_number option.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Refactor writing EBML lengths
Andreas Rheinhardt [Wed, 15 Apr 2020 02:05:09 +0000 (04:05 +0200)]
avformat/matroskaenc: Refactor writing EBML lengths

This commit factors the ability to write ordinary EBML numbers out of
the functions for writing EBML lengths. This is in preparation for
future commits.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Rename functions to better reflect what they do
Andreas Rheinhardt [Wed, 15 Apr 2020 01:39:37 +0000 (03:39 +0200)]
avformat/matroskaenc: Rename functions to better reflect what they do

EBML uses variable length integers both for the EBML IDs as well as for
the EBML lengths; Matroska also uses them for the TrackNumber in
(Simple)Blocks and for the lengths of laces when EBML lacing is used.

When encoding EBML lengths, certain encodings have a special meaning,
namely that the element has an unknown length. This is not so when
encoding general EBML variable length integers.

Yet the functions called ebml_num_size() and put_ebml_num() had this
special meaning hardcoded, i.e. they are there to write EBML lengths and
not general EBML numbers. So rename them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Make ebml_num_size() more robust
Andreas Rheinhardt [Thu, 2 Apr 2020 21:07:55 +0000 (23:07 +0200)]
avformat/matroskaenc: Make ebml_num_size() more robust

Matroska (or actually EBML) uses variable-length numbers where only
seven bits of every byte is usable for the length; the other bits encode
the length of the variable-length number. So in order to find out how
many bytes one needs to encode a given number one can use a loop like
while (num >> 7 * bytes) bytes++; the Matroska muxer effectively did this.

Yet it has a disadvantage: It is impossible for the result of a single
right shift of an unsigned number with most significant bit set to be
zero, because one can only shift by 0..(width - 1). On some
architectures like x64 it is not even possible to do it with undefined
right shifts in which case this leads to an infinite loop.

This can be easily avoided by switching to a loop whose condition is
(num >>= 7). The maximum value the so modified function can return
is 10; any value > 8 is invalid and will now lead to an assert in
put_ebml_num() or in start_ebml_master() (or actually in
put_ebml_size_unknown()).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroska: Move mime_tag lists to matroskadec
Andreas Rheinhardt [Thu, 16 Apr 2020 01:39:05 +0000 (03:39 +0200)]
avformat/matroska: Move mime_tag lists to matroskadec

They are not used any more by the muxer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskaenc: Improve mimetype search
Andreas Rheinhardt [Sun, 3 Nov 2019 12:06:49 +0000 (13:06 +0100)]
avformat/matroskaenc: Improve mimetype search

Use the mime_types of the corresponding AVCodecDescriptor instead of
tables specific to Matroska. The former are generally more encompassing:
They contain every item of the current lists except "text/plain" for
AV_CODEC_ID_TEXT and "binary" for AV_CODEC_ID_BIN_DATA.

The former has been preserved by special-casing it while the latter is
a hack added in c9212abf so that the demuxer (which uses the same tables)
sets the appropriate CodecID for broken files ("binary" is not a correct
mime type at all); using it for the muxer was a mistake. The correct
mime type for AV_CODEC_ID_BIN_DATA is "application/octet-stream" and
this is what one gets from the AVCodecDescriptor.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavcodec/pngdec: Pass ret from decode_iccp_chunk()
Michael Niedermayer [Fri, 17 Apr 2020 23:48:47 +0000 (01:48 +0200)]
avcodec/pngdec: Pass ret from decode_iccp_chunk()

Found while reviewing a patch fixing a similar issue

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/adpcm: update get_nb_samples() doc
Zane van Iperen [Sat, 18 Apr 2020 00:59:33 +0000 (00:59 +0000)]
avcodec/adpcm: update get_nb_samples() doc

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/adpcm_ima_{apc, ssi, oki}: replace while() with for()
Zane van Iperen [Sat, 18 Apr 2020 00:59:25 +0000 (00:59 +0000)]
avcodec/adpcm_ima_{apc, ssi, oki}: replace while() with for()

Per discussion at https://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/260854.html

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agofate/truehd: add a test for the truehd_core bitstream filter
James Almer [Sun, 19 Apr 2020 14:57:19 +0000 (11:57 -0300)]
fate/truehd: add a test for the truehd_core bitstream filter

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agofate: move TrueHD tests to their own file
James Almer [Sun, 19 Apr 2020 14:48:37 +0000 (11:48 -0300)]
fate: move TrueHD tests to their own file

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavformat/dashenc: add missing startWithSap attribute to AdaptationSet elements
James Almer [Thu, 16 Apr 2020 01:41:02 +0000 (22:41 -0300)]
avformat/dashenc: add missing startWithSap attribute to AdaptationSet elements

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavformat/dashenc: add a PlaybackRate element
James Almer [Thu, 16 Apr 2020 01:36:10 +0000 (22:36 -0300)]
avformat/dashenc: add a PlaybackRate element

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavformat/dashenc: add a maxSegmentDuration attribute to the Manifest
James Almer [Wed, 15 Apr 2020 21:02:44 +0000 (18:02 -0300)]
avformat/dashenc: add a maxSegmentDuration attribute to the Manifest

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agodoc/muxers: fix some dashenc option names
James Almer [Thu, 16 Apr 2020 01:47:44 +0000 (22:47 -0300)]
doc/muxers: fix some dashenc option names

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/qpeg: mark the init function as thread-safe and init cleanup capable
James Almer [Fri, 17 Apr 2020 03:03:37 +0000 (00:03 -0300)]
avcodec/qpeg: mark the init function as thread-safe and init cleanup capable

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/qpeg: export missing frame properties
James Almer [Fri, 17 Apr 2020 03:03:30 +0000 (00:03 -0300)]
avcodec/qpeg: export missing frame properties

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/qpeg: remove an unnecessary intermediary AVFrame
James Almer [Fri, 17 Apr 2020 02:20:43 +0000 (23:20 -0300)]
avcodec/qpeg: remove an unnecessary intermediary AVFrame

Decoding can be handled directly in the output frame.

Also ensure flushing cleans the reference frame in all cases.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavformat/oggenc: Don't free AVStream's priv_data, fix memleak
Andreas Rheinhardt [Tue, 14 Apr 2020 02:30:59 +0000 (04:30 +0200)]
avformat/oggenc: Don't free AVStream's priv_data, fix memleak

For FLAC, Speex, Opus and VP8 the Ogg muxer allocates two buffers
for building the headers: The first for extradata in an Ogg-specific
format and the second contains a Vorbiscomment. These buffers are
reachable via pointers in the corresponding AVStream's priv_data.

If an error happens during building the headers, the AVStream's
priv_data would be freed. This is pointless in general as it would be
freed generically anyway, but here it is actively harmful: If the second
of the aforementioned allocations fails, the first buffer would leak
upon freeing priv_data.

This commit stops freeing priv_data manually, which allows the muxer to
properly clean up in the deinit function.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/utils: Fix memleak when decoding subtitle in find_stream_info
Andreas Rheinhardt [Sat, 18 Apr 2020 19:36:09 +0000 (21:36 +0200)]
avformat/utils: Fix memleak when decoding subtitle in find_stream_info

avformat_find_stream_info() may decode some frames to get stream
information. And when it does this for subtitles, the decoded subtitles
leak.

(Decoding subtitles was added in b1511e00f6fefde6cb31b2e17f7812cfac1c8bd6
for PGS subtitles. When PGS subtitles originate from a container that
exports every segment as a packet of its own, no output will be
generated when decoding a packet, because not enough input is available.
Yet when used with PGS subtitles in the Matroska form a single packet
contains enough data to generate output. Yet said output is not freed,
hence this leak.)

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavcodec/bsf: Use macro for "packet is empty"
Andreas Rheinhardt [Sun, 19 Apr 2020 19:18:51 +0000 (21:18 +0200)]
avcodec/bsf: Use macro for "packet is empty"

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/rtsp: Put strings instead of pointers to strings into array
Andreas Rheinhardt [Fri, 3 Apr 2020 13:02:07 +0000 (15:02 +0200)]
avformat/rtsp: Put strings instead of pointers to strings into array

In this example, the difference in length between the shortest and
longest string is three, so that not using pointers to strings saves
space even on 32bit systems.

Moreover, there is no need to use a sentinel here; it can be replaced
with FF_ARRAY_ELEMS.

Reviewed-by: Ross Nicholson <phunkyfish@gmail.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/rtsp: Don't free uninitialized AVBPrint
Andreas Rheinhardt [Mon, 20 Apr 2020 01:31:56 +0000 (03:31 +0200)]
avformat/rtsp: Don't free uninitialized AVBPrint

Fixes Coverity ID 1462307.

Reviewed-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Ross Nicholson <phunkyfish@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/movenc: cosmetics
Limin Wang [Sat, 4 Apr 2020 03:46:27 +0000 (11:46 +0800)]
avformat/movenc: cosmetics

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Josh de Kock <josh@itanimul.li>
2 years agotools: stop using deprecated av_codec_next()
Josh de Kock [Tue, 14 Apr 2020 12:34:53 +0000 (13:34 +0100)]
tools: stop using deprecated av_codec_next()

Signed-off-by: Josh de Kock <josh@itanimul.li>
2 years agolavf/utils: stop using deprecated av_codec_next()
Josh de Kock [Tue, 14 Apr 2020 11:21:52 +0000 (12:21 +0100)]
lavf/utils: stop using deprecated av_codec_next()

Signed-off-by: Josh de Kock <josh@itanimul.li>
2 years agolavc: stop using deprecated av_codec_next()
Josh de Kock [Tue, 14 Apr 2020 12:33:01 +0000 (13:33 +0100)]
lavc: stop using deprecated av_codec_next()

Signed-off-by: Josh de Kock <josh@itanimul.li>
2 years agocmdutils: stop using deprecated av_codec_next()
Anton Khirnov [Tue, 14 Apr 2020 08:09:24 +0000 (10:09 +0200)]
cmdutils: stop using deprecated av_codec_next()

Signed-off-by: Josh de Kock <josh@itanimul.li>
2 years agolavc/hevcdec: fix the HEVC decoder crash when memory over-read
qoroliang [Fri, 13 Mar 2020 09:02:32 +0000 (17:02 +0800)]
lavc/hevcdec: fix the HEVC decoder crash when memory over-read

Fix an occasional crash for hevc decoder in ARM 32 platform, the
root cause is the memory over read(read cross the memory boundary)
in SAO NENO functions ff_hevc_sao_band_filter_neon_8 and
ff_hevc_sao_edge_filter_neon_8.

After this fix, the crash disapper in the massive Android phone
test.

Signed-off-by: qoroliang <qoroliang@tencent.com>
2 years agolibavformat/rtsp: pass protocol options for udp multicast
Wolfgang Haupt [Sun, 19 Apr 2020 17:14:41 +0000 (19:14 +0200)]
libavformat/rtsp: pass protocol options for udp multicast

Protocol options like buffer_size need to be passed to the
underlying transport implementation for udp multicasts as well.

Signed-off-by: Marton Balint <cus@passwd.hu>
2 years agoswscale: aarch64: Avoid using the x18 register
Martin Storsjö [Sat, 18 Apr 2020 21:24:06 +0000 (00:24 +0300)]
swscale: aarch64: Avoid using the x18 register

The x18 is a reserved platform register on Darwin and Windows.

x8/w8 seems to be unused in this function though (and same about
x10 and x14), so there's really no reason to use x18 here - just change
the uses of x18/w18 into x8/w8 instead without any further rewrites.

Signed-off-by: Martin Storsjö <martin@martin.st>
2 years agoconfigure: add MLP parser as dependency to MLP and TrueHD demuxers
James Almer [Sun, 19 Apr 2020 18:57:22 +0000 (15:57 -0300)]
configure: add MLP parser as dependency to MLP and TrueHD demuxers

It's needed to assemble complete frames.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/truehd_core_bsf: Remove unused AVClass pointer
Andreas Rheinhardt [Sat, 18 Apr 2020 00:45:02 +0000 (02:45 +0200)]
avcodec/truehd_core_bsf: Remove unused AVClass pointer

The context structure of the truehd_core bsf had a pointer to a const
AVClass as its first member; yet this bsf does not have any AVClass
associated with it, so that this pointer is always NULL. So remove it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavcodec/rv40dsp: Fix integer overflows in rv40_weight_func_*()
Michael Niedermayer [Sun, 2 Feb 2020 20:01:12 +0000 (21:01 +0100)]
avcodec/rv40dsp: Fix integer overflows in rv40_weight_func_*()

Fixes: signed integer overflow: 40550400 * 128 cannot be represented in type 'int'
Fixes: 20331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV40_fuzzer-5676685725007872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavformat/rtp: Pass sources and block filter addresses via sdp file for rtp
phunkyfish [Tue, 7 Apr 2020 22:38:29 +0000 (23:38 +0100)]
avformat/rtp: Pass sources and block filter addresses via sdp file for rtp

Signed-off-by: Marton Balint <cus@passwd.hu>
2 years agoavformat/mpc: Simplify cleanup
Andreas Rheinhardt [Thu, 2 Apr 2020 16:09:49 +0000 (18:09 +0200)]
avformat/mpc: Simplify cleanup

Currently Musepack allocates an array that needs to be freed later in
the demuxer's read_close-function; it is the sole reason for said
function's existence. But it is unnecessary, because one can store this
array in the stream's priv_data pointer, so that it will be freed
generically.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/matroskadec: Remove redundant setting of chapter titles
Andreas Rheinhardt [Mon, 13 Apr 2020 19:56:47 +0000 (21:56 +0200)]
avformat/matroskadec: Remove redundant setting of chapter titles

Chapter titles are added to the chapter's metadata since 6cb6e159,
yet since 012867f0 (the predecessor of) avpriv_new_chapter() already
adds the title to the chapter's metadata. So setting it again in
matroskadec.c is redundant and expensive.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agofate/matroska: Add test for chapters, Vorbis and WebM DASH
Andreas Rheinhardt [Mon, 13 Apr 2020 05:46:09 +0000 (07:46 +0200)]
fate/matroska: Add test for chapters, Vorbis and WebM DASH

Moreover, putting the Cues in front of the Clusters by reserving space
in advance is also tested.

The new capability of using ffprobe during a remux/transcode test are
used here for information about the chapters.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agofate: Allow to test temporary files with ffprobe
Andreas Rheinhardt [Mon, 13 Apr 2020 02:09:21 +0000 (04:09 +0200)]
fate: Allow to test temporary files with ffprobe

This is primarily intended to test that muxers correctly write chapters
or metadata; but given that it does this by having our demuxers read the
generated files, it also tests demuxers. And of course it may prove
useful for encoders, too.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agofate: Fix dependencies for ffprobe tests with external samples
Andreas Rheinhardt [Mon, 13 Apr 2020 17:50:05 +0000 (19:50 +0200)]
fate: Fix dependencies for ffprobe tests with external samples

Up until now, they were appended to the FATE_EXTERN-$(CONFIG_FFMPEG)
variable and were therefore activated when ffmpeg was enabled regardless
of whether ffprobe was enabled.

Also the same happened with FATE_SAMPLES_FASTSTART, although the
corresponding test (mov-faststart-4gb-overflow) only requires external
samples.

Furthermore, remove the unused FATE_FULL variable (FATE_EXTERN_FFPROBE has
taken its place).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavfilter: add maskedthreshold filter
Paul B Mahol [Wed, 15 Apr 2020 10:10:30 +0000 (12:10 +0200)]
avfilter: add maskedthreshold filter

2 years agoavfilter: add tmedian filter
Paul B Mahol [Mon, 13 Apr 2020 14:12:50 +0000 (16:12 +0200)]
avfilter: add tmedian filter

2 years agoavcodec/pngdec: set return value on av_stereo3d_create_side_data() failure
Peter Ross [Fri, 17 Apr 2020 12:35:43 +0000 (22:35 +1000)]
avcodec/pngdec: set return value on av_stereo3d_create_side_data() failure

Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2 years agoavformat/flacenc: Don't allocate updated streaminfo separately
Andreas Rheinhardt [Sun, 12 Apr 2020 16:23:44 +0000 (18:23 +0200)]
avformat/flacenc: Don't allocate updated streaminfo separately

It is a small buffer of a known, fixed size and so it should simply be
put into the muxer's context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/flacenc: Only update streaminfo if it has changed
Andreas Rheinhardt [Sun, 12 Apr 2020 15:49:30 +0000 (17:49 +0200)]
avformat/flacenc: Only update streaminfo if it has changed

An AVStream's codecpar is supposed to be filled by the caller before
avformat_write_header(); if the CodecParameters change, the caller
should signal this via packet side data, but not touch the AVStream's
codecpar.

The FLAC muxer checks for packet side data containing updated extradata,
yet if nothing has arrived by the time the trailer is written, the
already written extradata is overwritten by the very same extradata
again, unless the output is unseekable, in which case a warning that the
FLAC header can't be rewritten is emitted.

This commit changes this by only trying to rewrite the extradata if a
new streaminfo arrived via packet side data. Only then is a warning
emitted in case the output is unseekable.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agolibavformat/mux, mxfenc: Don't initialize unnecessarily
Andreas Rheinhardt [Tue, 31 Mar 2020 07:54:11 +0000 (09:54 +0200)]
libavformat/mux, mxfenc: Don't initialize unnecessarily

When no packet could be output, the interleavement functions
nevertheless initialized the packet destined for output (with the
exception of the data and size fields, making the initialization
pointless), although it will not be used at all. So remove the
initializations.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/mux: Remove pointless timestamp backups
Andreas Rheinhardt [Tue, 13 Aug 2019 02:47:26 +0000 (04:47 +0200)]
avformat/mux: Remove pointless timestamp backups

write_packet() currently saves the original timestamps of the packet it
got and restores them in case writing fails. This is unnecessary as we
are no longer working directly with the user-supplied AVPacket here; and
it is also pointless because the timestamps may already have been
altered before write_packet().

So remove this and add a general comment to the function that timestamps
may be modified; also remove a long outdated comment about side data.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/mux: Don't modify packets we don't own
Andreas Rheinhardt [Tue, 13 Aug 2019 02:47:25 +0000 (04:47 +0200)]
avformat/mux: Don't modify packets we don't own

The documentation of av_write_frame() explicitly states that the function
doesn't take ownership of the packets sent to it; while av_write_frame()
does not directly unreference the packets after having written them, it
nevertheless modifies the packet in various ways:
1. The timestamps might be modified either by prepare_input_packet() or
compute_muxer_pkt_fields().
2. If a bitstream filter gets applied, it takes ownership of the
reference and the side-data in the packet sent to it.
In case of do_packet_auto_bsf(), the end result is that the returned packet
contains the output of the last bsf in the chain. If an error happens,
a blank packet will be returned; a packet may also simply not lead to
any output (vp9_superframe).
This also implies that side data needs to be really copied and can't be
shared with the input packet.
The method choosen here minimizes copying of data: When the input isn't
refcounted and no bitstream filter is applied, the packet's data will
not be copied.

Notice that packets that contain uncoded frames are exempt from this
because these packets are not owned by and returned to the user. This
also moves unreferencing the packets containing uncoded frames to
av_write_frame() in the noninterleaved codepath; in the interleaved
codepath, these packets are already freed in av_interleaved_write_frame(),
so that unreferencing the packets in write_uncoded_frame_internal() is
no longer needed. It has been removed.

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/mux: Remove redundant resetting
Andreas Rheinhardt [Sat, 11 Apr 2020 11:48:50 +0000 (13:48 +0200)]
avformat/mux: Remove redundant resetting

Now that ff_interleave_add_packet() always returns blank packets, the
input packet to ff_interleave_packet_per_dts() will always be blank on
return as well (if supplied) and the same goes for interleave_packet()
in mux.c. Document these facts and remove the redundant resetting that
happened in av_interleaved_write_frame().

The last reference to the (long removed) destruct field that AVPackets
once had has been removed as well when updating the documentation of
ff_interleave_packet_per_dts().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/mux: Fix leak when adding packet to interleavement queue fails
Andreas Rheinhardt [Sat, 11 Apr 2020 11:37:24 +0000 (13:37 +0200)]
avformat/mux: Fix leak when adding packet to interleavement queue fails

When an error happened in ff_interleave_add_packet() when adding
a packet to the packet queue, said packet would not be unreferenced
in ff_interleave_add_packet(), but would be zeroed in
av_interleaved_write_frame(), which results in a memleak.

This has been fixed: ff_interleave_add_packet() now always unreferences
the input packet on error; as a result, it always returns blank packets
which has been documented. Relying on this a call to av_packet_unref()
in ff_audio_rechunk_interleave() can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/mux: Fix leaks on error when writing noninterleaved uncoded frames
Andreas Rheinhardt [Sat, 11 Apr 2020 09:45:32 +0000 (11:45 +0200)]
avformat/mux: Fix leaks on error when writing noninterleaved uncoded frames

If writing uncoded frames in noninterleaved mode fails at the preparatory
steps (i.e. before it reaches write_packet()), the packet would not be
unreferenced and the frame would leak. This is fixed by unreferencing
the packet in write_uncoded_frame_internal() instead.

This also makes it possible to remove the unreferencing in
write_packet() itself: In noninterleaved mode frames are now freed in
write_uncoded_frame_internal(), while they are freed in interleaved
mode when their containing packet gets unreferenced (like normal
packets).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/mux: Make uncoded frames av_packet_unref() compatible
Andreas Rheinhardt [Fri, 9 Aug 2019 12:32:15 +0000 (14:32 +0200)]
avformat/mux: Make uncoded frames av_packet_unref() compatible

Currently uncoded frames (i.e. packets whose data actually points to an
AVFrame) are not refcounted. As a consequence, calling av_packet_unref()
on them will not free them, but may simply make sure that they leak by
losing the pointer to the frame.

This commit changes this by actually making uncoded frames refcounted.
In order not to rely on sizeof(AVFrame) (which is not part of the public
API and so must not be used here in libavformat) the packet's data is
changed to a (padded) buffer containing just a pointer to an AVFrame.
Said buffer is owned by an AVBuffer with a custom free function that
frees the frame as well as the buffer. Thereby the pointer/the AVBuffer
owns the AVFrame.

Said ownership can actually be transferred by copying and resetting
the pointer, as might happen when actually writing the uncoded frames
in AVOutputFormat.write_uncoded_frame() (although currently no muxer
makes use of this possibility).

This makes packets containing uncoded frames compatible with
av_packet_unref(). This already has three advantages in interleaved mode:
1. If an error happens at the preparatory steps (before the packet is
put into the interleavement queue), the frame is properly freed.
2. If the trailer is never written, the frames still in the
interleavement queue will now be properly freed by
ff_packet_list_free().
3. The custom code for moving the packet to the packet list in
ff_interleave_add_packet() can be removed.

It will also simplify fixing further memleaks in future commits.

Suggested-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavcodec/bsf: use simplified algorithm for bsf_list chained filtering
Marton Balint [Sun, 29 Mar 2020 23:31:43 +0000 (01:31 +0200)]
avcodec/bsf: use simplified algorithm for bsf_list chained filtering

Based on the one in ffmpeg.c and it is not using an extra flush_idx variable.

Signed-off-by: Marton Balint <cus@passwd.hu>
2 years agoavfilter/af_acrossover: Check sscanf() return value
Limin Wang [Sun, 29 Mar 2020 00:08:04 +0000 (08:08 +0800)]
avfilter/af_acrossover: Check sscanf() return value

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2 years agoavfilter/af_astats: add noise floor count stat
Paul B Mahol [Fri, 17 Apr 2020 10:56:19 +0000 (12:56 +0200)]
avfilter/af_astats: add noise floor count stat

2 years agoavfilter/af_astats: add slice threading support
Paul B Mahol [Thu, 16 Apr 2020 15:55:11 +0000 (17:55 +0200)]
avfilter/af_astats: add slice threading support

2 years agoavfilter/af_astats: measure noise floor
Paul B Mahol [Thu, 16 Apr 2020 14:10:12 +0000 (16:10 +0200)]
avfilter/af_astats: measure noise floor

2 years agoavcodec/mv30: use aandcttables
Peter Ross [Fri, 10 Apr 2020 13:14:35 +0000 (23:14 +1000)]
avcodec/mv30: use aandcttables

2 years agoavcodec/mv30: remove unused table elements
Peter Ross [Fri, 10 Apr 2020 13:10:11 +0000 (23:10 +1000)]
avcodec/mv30: remove unused table elements

2 years agoavcodec/vp3: fix indentation
Peter Ross [Tue, 7 Apr 2020 12:05:35 +0000 (22:05 +1000)]
avcodec/vp3: fix indentation

2 years agofftools/ffmpeg_opt: Check attachment filesize
Andreas Rheinhardt [Wed, 15 Apr 2020 18:54:42 +0000 (20:54 +0200)]
fftools/ffmpeg_opt: Check attachment filesize

The data of an attachment file is put into an AVCodecParameter's
extradata. The corresponding size field has type int, yet there was no
check for the size to fit into an int. As a consequence, it was possible
to create extradata with negative size (by using a big enough max_alloc).

Other errors were also possible: If SIZE_MAX < INT64_MAX (e.g. on 32bit
systems) then the file size might be truncated before the allocation;
and avio_read() takes an int, too, so one would not have read as much
as one desired.

Furthermore, the extradata is now padded as is required.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavutil/log: update text requesting samples
Marton Balint [Thu, 16 Apr 2020 22:04:47 +0000 (00:04 +0200)]
avutil/log: update text requesting samples

Signed-off-by: Marton Balint <cus@passwd.hu>
2 years agoavdevice/opengl: add support of wrapped avframe codec
Marton Balint [Sun, 5 Apr 2020 22:21:47 +0000 (00:21 +0200)]
avdevice/opengl: add support of wrapped avframe codec

Also change the default to that.

Signed-off-by: Marton Balint <cus@passwd.hu>
2 years agoavdevice/xv: add support of wrapped avframe codec
Marton Balint [Sun, 5 Apr 2020 22:01:27 +0000 (00:01 +0200)]
avdevice/xv: add support of wrapped avframe codec

Also change the default to that.

Signed-off-by: Marton Balint <cus@passwd.hu>
2 years agoavcodec: add a WebP parser
James Almer [Mon, 13 Apr 2020 23:44:06 +0000 (20:44 -0300)]
avcodec: add a WebP parser

Based on code from the BMP parser.

Addresses ticket #8574

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/ac3dec_fixed: Fix several invalid left shifts in scale_coefs()
Michael Niedermayer [Sat, 1 Feb 2020 20:25:33 +0000 (21:25 +0100)]
avcodec/ac3dec_fixed: Fix several invalid left shifts in scale_coefs()

Fixes: left shift of negative value -14336
Fixes: 20298/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5675484201615360

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/flac_parser: Do not lose header count in find_headers_search()
Michael Niedermayer [Mon, 3 Feb 2020 22:20:23 +0000 (23:20 +0100)]
avcodec/flac_parser: Do not lose header count in find_headers_search()

Fixes: Timeout
Fixes: out of array access
Fixes: 20274/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-5649631988154368
Fixes: 19275/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-5757535722405888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/audiodsp: Fix integer overflow in scalarproduct_int16_c()
Michael Niedermayer [Sun, 2 Feb 2020 19:02:55 +0000 (20:02 +0100)]
avcodec/audiodsp: Fix integer overflow in scalarproduct_int16_c()

Fixes: signed integer overflow: 2145417478 + 76702564 cannot be represented in type 'int'
Fixes: 20313/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RA_144_fuzzer-5734487724130304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec: Add explicit capability flag for encoder flushing
Philip Langdale [Fri, 10 Apr 2020 20:32:11 +0000 (13:32 -0700)]
avcodec: Add explicit capability flag for encoder flushing

Previously, there was no way to flush an encoder such that after
draining, the encoder could be used again. We generally suggested
that clients teardown and replace the encoder instance in these
situations. However, for at least some hardware encoders, the cost of
this tear down/replace cycle is very high, which can get in the way of
some use-cases - for example: segmented encoding with nvenc.

To help address that use case, we added support for calling
avcodec_flush_buffers() to nvenc and things worked in practice,
although it was not clearly documented as to whether this should work
or not. There was only one previous example of an encoder implementing
the flush callback (audiotoolboxenc) and it's unclear if that was
intentional or not. However, it was clear that calling
avocdec_flush_buffers() on any other encoder would leave the encoder in
an undefined state, and that's not great.

As part of cleaning this up, this change introduces a formal capability
flag for encoders that support flushing and ensures a flush call is a
no-op for any other encoder. This allows client code to check if it is
meaningful to call flush on an encoder before actually doing it.

I have not attempted to separate the steps taken inside
avcodec_flush_buffers() because it's not doing anything that's wrong
for an encoder. But I did add a sanity check to reject attempts to
flush a frame threaded encoder because I couldn't wrap my head around
whether that code path was actually safe or not. As this combination
doesn't exist today, we'll deal with it if it ever comes up.

2 years agoavformat/dashenc: fix typo in ProducerReferenceTime elements
James Almer [Wed, 15 Apr 2020 20:08:13 +0000 (17:08 -0300)]
avformat/dashenc: fix typo in ProducerReferenceTime elements

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agolavc/jpeg2000dec: Cosmetics, re-indent after last commit.
Carl Eugen Hoyos [Wed, 15 Apr 2020 18:03:33 +0000 (20:03 +0200)]
lavc/jpeg2000dec: Cosmetics, re-indent after last commit.

2 years agolavc/jpeg2000dec: Allow to force a compatible pix_fmt.
Carl Eugen Hoyos [Mon, 13 Apr 2020 14:25:02 +0000 (16:25 +0200)]
lavc/jpeg2000dec: Allow to force a compatible pix_fmt.

This copies the behaviour of the libopenjpeg decoder.
Fixes ticket #5919.

2 years agoffmpeg: Do not clip timestamps at LONG_MAX.
Carl Eugen Hoyos [Mon, 13 Apr 2020 12:01:14 +0000 (14:01 +0200)]
ffmpeg: Do not clip timestamps at LONG_MAX.

Fixes ticket #8612.

2 years agoavformat/movenc: remove call to av_copy_packet_side_data() when concatenating eac3...
James Almer [Tue, 14 Apr 2020 20:31:26 +0000 (17:31 -0300)]
avformat/movenc: remove call to av_copy_packet_side_data() when concatenating eac3 syncframes

This generates a potential memory leak, and mixes side data from the last
packet with other properties from the first.

Keep all the properties from the first packet only in the output packet
instead.

Signed-off-by: James Almer <jamrial@gmail.com>
2 years agoavcodec/cbs_jpeg_syntax_template: Check array index in huffman_table()
Michael Niedermayer [Sun, 12 Apr 2020 20:06:10 +0000 (22:06 +0200)]
avcodec/cbs_jpeg_syntax_template: Check array index in huffman_table()

Fixes: index 224 out of bounds for type 'uint8_t [224]'
Fixes: 21534/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-6291612167831552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoavcodec/cbs_jpeg_syntax_template: Check table index before use in dht()
Michael Niedermayer [Sun, 12 Apr 2020 19:38:55 +0000 (21:38 +0200)]
avcodec/cbs_jpeg_syntax_template: Check table index before use in dht()

Fixes: out of array access
Fixes: 21515/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5766121576988672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2 years agoconfigure: fix clang on macOS 10.15
Josh de Kock [Tue, 14 Apr 2020 17:42:09 +0000 (18:42 +0100)]
configure: fix clang on macOS 10.15

Works around a bug in the newer Xcode 11's clang with -fstack-check
emitting bad code with misaligned call instructions.

This fixes Trac #8073

2 years agoavcodec/mediacodec_wrapper: fix {input,output}_buffers global reference leak
Matthieu Bouron [Thu, 9 Apr 2020 14:53:21 +0000 (16:53 +0200)]
avcodec/mediacodec_wrapper: fix {input,output}_buffers global reference leak

Fixes ticket #8607.

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
2 years agoavformat/dashdec: add attribute lang for audio and subtitle streams
Steven Liu [Tue, 31 Mar 2020 12:16:14 +0000 (20:16 +0800)]
avformat/dashdec: add attribute lang for audio and subtitle streams

There should have language in the metadata of streams which show to user

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2 years agoavformat/hlsenc: add hls_fmp4_init_resend option
Steven Liu [Tue, 7 Apr 2020 09:30:18 +0000 (17:30 +0800)]
avformat/hlsenc: add hls_fmp4_init_resend option

add option for resend init file after m3u8 refresh everytime.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2 years agoavcodec/v4l2_m2m: handle v4l2 end of stream event
Ming Qian [Wed, 1 Apr 2020 02:38:45 +0000 (10:38 +0800)]
avcodec/v4l2_m2m: handle v4l2 end of stream event

When flushing the capture buffers, the driver may send a V4L2_EVENT_EOS
to notify that draining is completed. Currently, v4l2_m2m does not
subscribe to this event, which can cause some devices (i.e. imx8qm) to
hang at the end of encoding/decoding. Support for handling the event is
added in this commit.

Some devices may not signal V4L2_EVENT_EOS. This is logged as a warning
message during initialization and not treated as a fatal error.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2 years agoavfilter/af_amix: unbreak FATE, increase iterator when breaking from loop
Paul B Mahol [Tue, 14 Apr 2020 17:18:44 +0000 (19:18 +0200)]
avfilter/af_amix: unbreak FATE, increase iterator when breaking from loop

2 years agoavformat/filmstripenc: Use ff_raw_write_packet()
Andreas Rheinhardt [Tue, 7 Apr 2020 21:23:12 +0000 (23:23 +0200)]
avformat/filmstripenc: Use ff_raw_write_packet()

The only difference of the currently used write_packet()-function to
ff_raw_write_packet() is that the former also counts the number of
frames. Yet doing so in the muxer itself is unnecessary as this is
already done generically in write_packet() in libavformat/mux.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/rso: Don't reimplement ff_raw_write_packet()
Andreas Rheinhardt [Tue, 7 Apr 2020 20:53:42 +0000 (22:53 +0200)]
avformat/rso: Don't reimplement ff_raw_write_packet()

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/amr: Don't reimplement ff_raw_write_packet()
Andreas Rheinhardt [Tue, 7 Apr 2020 20:50:47 +0000 (22:50 +0200)]
avformat/amr: Don't reimplement ff_raw_write_packet()

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/Makefile: Don't add dependency twice
Andreas Rheinhardt [Tue, 7 Apr 2020 20:30:26 +0000 (22:30 +0200)]
avformat/Makefile: Don't add dependency twice

as has happened with flac_picture.o and the Matroska demuxer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/Makefile: Remove false dependencies of WebM and Matroska muxer
Andreas Rheinhardt [Tue, 7 Apr 2020 20:14:13 +0000 (22:14 +0200)]
avformat/Makefile: Remove false dependencies of WebM and Matroska muxer

These muxers don't depend on the WebM Chunk or the WebM DASH Manifest
muxers.

Furthermore, remove some #if checks in webm_chunk.c and webmdashenc.c.
They are always true now that webm_chunk.c and webmdashenc.c are only
compiled when their corresponding muxers are enabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/Makefile: Remove false dependency of WebM DASH manifest muxer
Andreas Rheinhardt [Tue, 7 Apr 2020 20:01:30 +0000 (22:01 +0200)]
avformat/Makefile: Remove false dependency of WebM DASH manifest muxer

It does not use anything from libavformat/matroska.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/webmdashenc: Remove unnecessary header
Andreas Rheinhardt [Tue, 7 Apr 2020 19:53:08 +0000 (21:53 +0200)]
avformat/webmdashenc: Remove unnecessary header

avio_internal.h has been included in this muxer since the beginning and
was never needed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoavformat/webm_chunk: Remove superfluous headers
Andreas Rheinhardt [Tue, 7 Apr 2020 19:31:27 +0000 (21:31 +0200)]
avformat/webm_chunk: Remove superfluous headers

libavutil/avstring.h is unnecessary since 8a632b3e. The other
unnecessary headers were never used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2 years agoconfigure, libavformat/Makefile: Fix webm_chunk dependencies
Andreas Rheinhardt [Tue, 7 Apr 2020 19:25:48 +0000 (21:25 +0200)]
configure, libavformat/Makefile: Fix webm_chunk dependencies

The webm_chunk muxer requires the WebM muxer, yet it does not directly
require anything from libavformat/matroska.c (it does not even include
the corresponding header). So remove the dependency from the Makefile
and add a _select to configure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>