Commit Graph

24042 Commits

Author SHA1 Message Date
Andreas Rheinhardt
779dba0fc0 avformat/flacdec, takdec: Use FFRawDemuxerContext directly
The beginning of the private contexts of both the FLAC and the TAK
demuxer currently mimick FFRawDemuxerContext: A pointer to an AVClass
followed by the AVOpt-enabled field raw_packet_size. Said field is only
used by the demuxers' read_packet functions via
ff_raw_read_partial_packet(), which treats the private context as an
FFRaawDemuxerContext. Yet this is fragile, so better include a
FFRawDemuxerContext struct at the beginning of said demuxers' private
contexts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 16:03:17 +02:00
Andreas Rheinhardt
cd564ee547 avformat/codec2: Remove unused AVClass with wrong category
The codec2 muxer has no options and so it needs no AVClass;
and it certainly needs no AVClass of category AV_CLASS_CATEGORY_DEMUXER.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 16:03:17 +02:00
Andreas Rheinhardt
63ad9ba4b5 avformat/asfenc: Deduplicate AVClasses
The child_class_next API relied on different (de)muxers to use
different AVClasses; yet this API has been replaced by
child_class_iterate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 16:03:17 +02:00
Andreas Rheinhardt
c64cfef91e avformat/aptxdec: Deduplicate AVClasses
The child_class_next API relied on different (de)muxers to use
different AVClasses; yet this API has been replaced by
child_class_iterate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 16:03:17 +02:00
Andreas Rheinhardt
41ab409332 avformat/Makefile: Remove rawdec dependency from aptx, codec2 demuxers
These demuxers don't need anything from rawdec; they furthermore only
used rawdec.h to include opt.h. Both of this has been fixed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 16:03:17 +02:00
Andreas Rheinhardt
2c984ecbdd avformat/Makefile: Add missing rawdec dependency for IPU demuxer
Needed for ff_raw_read_partial_packet and ff_raw_options.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 16:03:17 +02:00
Andreas Rheinhardt
3da2f4502a avformat/xmv: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 15:21:31 +02:00
Andreas Rheinhardt
f545155eb3 avformat/webvttdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 15:19:55 +02:00
Andreas Rheinhardt
d6d113e454 avformat/wc3movie: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 15:19:03 +02:00
Andreas Rheinhardt
04aa4065d7 avformat/vplayerdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 14:24:01 +02:00
Andreas Rheinhardt
21e40af378 avformat/vividas: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 14:21:49 +02:00
Andreas Rheinhardt
c1141aa71a avformat/vapoursynth: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 14:09:15 +02:00
Andreas Rheinhardt
24e4127cb4 avformat/tiertexseq: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 14:08:00 +02:00
Andreas Rheinhardt
7ef252b64a avformat/tedcaptionsdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 14:06:21 +02:00
Andreas Rheinhardt
480094b2a6 avformat/subviewer1dec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 14:02:57 +02:00
Andreas Rheinhardt
43ac74a7d8 avformat/subviewerdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 14:00:37 +02:00
Andreas Rheinhardt
c6686388aa avformat/stldec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:59:11 +02:00
Andreas Rheinhardt
511bd6af47 avformat/srtdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:57:42 +02:00
Andreas Rheinhardt
1ebda24904 avformat/sierravmd: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:54:52 +02:00
Andreas Rheinhardt
5542f78d46 avformat/segafilm: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:53:48 +02:00
Andreas Rheinhardt
9ef7582446 avformat/sccdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:50:28 +02:00
Andreas Rheinhardt
7ae7d93653 avformat/samidec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:49:47 +02:00
Andreas Rheinhardt
48de45ea59 avformat/rmdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:32:15 +02:00
Andreas Rheinhardt
5a58e58215 avformat/realtextdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:30:51 +02:00
Andreas Rheinhardt
b00c9c74af avformat/pp_bnk: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:25:42 +02:00
Andreas Rheinhardt
ae123057a3 avformat/pjsdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:24:32 +02:00
Andreas Rheinhardt
d2574262a5 avformat/paf: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:22:34 +02:00
Andreas Rheinhardt
f12cdf8954 avformat/omadec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:19:34 +02:00
Andreas Rheinhardt
7c684827d9 avformat/oggdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:05:22 +02:00
Andreas Rheinhardt
3bb61f55b7 avformat/nutdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 13:03:39 +02:00
Andreas Rheinhardt
06f31d01e6 avformat/nsvdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 12:53:41 +02:00
Andreas Rheinhardt
2135167c30 avformat/mxfdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 12:52:11 +02:00
Andreas Rheinhardt
9821217a4f avformat/mpsubdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 12:51:20 +02:00
Andreas Rheinhardt
3237d955e8 avformat/mpl2dec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 11:48:45 +02:00
Andreas Rheinhardt
bcdc1d1060 avformat/mpeg: Simplify cleanup after reading vobsub header fails
by setting the FF_FMT_INIT_CLEANUP flag. Furthermore, also remove
an unnecessary check for NULL before avformat_close_input().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-08 11:46:40 +02:00
Andreas Rheinhardt
c6e9672b50 avformat/mov: Simplify cleanup after read_header failure
By default, a demuxer's read_close function is not called automatically
if an error happens when reading the header; instead it is up to the
demuxer to clean up after itself in this case. The mov demuxer did this
by calling its read_close function when it encountered some errors when
reading the header.

This commit changes this by setting the FF_FMT_INIT_CLEANUP flag so that
mov_read_close() is automatically called when an error happens when
reading the header.

(Btw: mov_read_close() is not idempotent: Calling it twice is
dangerouos, because MOVContext.frag_index.item will be av_freep'ed,
yet MOVContext.frag_index.nb_items won't be reset. So the calls to
mov_read_close() have to be removed before the switch to freeing
generically.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 23:50:02 +02:00
Andreas Rheinhardt
cc768bf7e4 avformat/mlvdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 23:46:47 +02:00
Andreas Rheinhardt
da45c89fe1 avformat/microdvddec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 23:42:13 +02:00
Andreas Rheinhardt
d18eee412a avformat/mccdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 22:56:34 +02:00
Andreas Rheinhardt
d32a403102 avformat/matroskadec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 22:51:05 +02:00
Andreas Rheinhardt
7d0e70d372 avformat/lrcdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 22:41:30 +02:00
Andreas Rheinhardt
37a0fa55df avformat/libopenmpt: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 22:32:55 +02:00
Andreas Rheinhardt
87319ed26f avformat/libgme: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 22:26:44 +02:00
Andreas Rheinhardt
0d00167b7e avformat/jvdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 22:19:09 +02:00
Andreas Rheinhardt
7556490b09 avformat/jacosubdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 22:14:50 +02:00
Andreas Rheinhardt
7a1037b6bd avformat/icodec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 22:13:06 +02:00
Andreas Rheinhardt
0a7e911108 avformat/hls: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 21:51:40 +02:00
Andreas Rheinhardt
c3ba8f0d7e avformat/dashdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 21:48:46 +02:00
Andreas Rheinhardt
2ca36ef08b avformat/concatdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

(Btw: concat_read_close() is not idempotent (it frees cat->files, but
doesn't reset cat->nb_files), so this demuxer was incompatible with
simply calling read_close generically upon read_header failure.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 21:47:20 +02:00
Andreas Rheinhardt
b10668dd61 avformat/brstm: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 21:43:15 +02:00
Andreas Rheinhardt
1500b7dfa5 avformat/av1dec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 21:40:13 +02:00
Andreas Rheinhardt
ef7eaa4529 avformat/assdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 21:35:49 +02:00
Andreas Rheinhardt
0de329e8e8 avformat/aqtitledec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 21:32:24 +02:00
Andreas Rheinhardt
58da6b18a3 avformat/ape: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 21:26:43 +02:00
Andreas Rheinhardt
609672a4a3 avformat/avidec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 21:23:13 +02:00
Andreas Rheinhardt
822be43849 avformat/aaxdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 21:15:33 +02:00
Andreas Rheinhardt
b09b166829 avformat/aadec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 20:57:43 +02:00
Andreas Rheinhardt
f7fb09cb00 avformat/4xm: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 20:54:53 +02:00
Andreas Rheinhardt
0d81c0a10e avformat: Redo cleanup of demuxers upon read_header() failure
If reading the header fails, the demuxer's read_close() function (if
existing) is not called automatically; instead several demuxers call it
via "goto fail" in read_header().

This commit intends to change this by adding an internal flag for
demuxers that can be used to set on a per-AVInputFormat basis whether
read_close() should be called generically after an error during
read_header().

The flag controlling this behaviour needs to be added because it might
be unsafe to call read_close() generally (e.g. this might lead to
read_close() being called twice and this might e.g. lead to double-frees
if av_free() is used instead of av_freep(); or a size field has not
been reset after freeing the elements (see the mov demuxer for an
example of this)).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 20:48:50 +02:00
Andreas Rheinhardt
0f6b34bfec avformat: Add internal flags for AV(In|Out)putFormat
Both AVInputFormat and AVOutputFormat currently lack an equivalent to
AVCodec's caps_internal. E.g. if reading a header fails, each demuxer
is currently required to clean up manually, which often means to just
call the demuxer's read_close function. This could (and will) be done
generically via an equivalent of FF_CODEC_CAP_INIT_CLEANUP.

Because of the unholy ABI-relationship between libavdevice and
libavformat adding such a flag is only possible when the ABI is open
(despite the flag not being part of the public API), such as now.
Therefore such a flag is also added to AVOutputFormat, despite there
being no immediate use for it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-07 20:22:22 +02:00
Michael Niedermayer
343d950a4a avformat/matroskadec: Fix handling of huge default durations
Fixes: negation of -9223372036854775808 cannot be represented in type 'int64_t' (aka 'long'); cast to an unsigned type to negate this value to itself
Fixes: 33997/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6752039691485184

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-06 21:44:31 +02:00
Kyle Schwarz
a61d190972 libavformat/rtpdec_rfc4175: Check for zero pgroup before mod
Signed-off-by: Kyle Schwarz <zeranoe@gmail.com>
2021-07-06 16:37:59 +02:00
Andriy Gelman
6df4bcf1d0 avformat/rtsp: Include rtcp in port range check
Currently it is only checked that the rtp port does not exceed rtp_port_max.

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2021-07-05 13:37:39 -04:00
Andriy Gelman
d1f78067a6 avformat/rtsp: Reindent after previous commit
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2021-07-05 13:37:26 -04:00
Andriy Gelman
02387de90e avformat/rtsp: Set port_off to zero for low min/max port range
Fixes:
$ ffmpeg -min_port 32000 -max_port 32001 -i rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov -f null -
[1]    303871 floating point exception (core dumped)

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2021-07-05 13:36:22 -04:00
Andriy Gelman
8257d6dda6 avformat/rtsp: Fix timeout option
92c40ef882 added a listen_timeout option
for sdp. This allowed a user to set variable timeout which was
originally hard coded to 10 seconds.

The commit used the initial_timeout variable to store the value. But
this variable is shared with rtsp where it's used to infer a "listen"
mode. Thus, the timeout value could not be set in rtsp, and the default
value (initial_timeout = -1) would give 100ms timeout.

This was attempted to be fixed in c8101aabee,
which changed the meaning of initial_timeout = -1 to be an infinite
timeout. However, it did not address the issue that the timeout could
still not be set. Being able to set the timeout is useful because it
allows to automatically reconfigure from a udp to tcp connection in the
lower transport.

In this commit this is fixed by using the stimeout variable to
store the timeout value.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2021-07-05 12:49:55 -04:00
Michael Niedermayer
9d40782088 avformat/ftp: Check for av_strtok() failure
Fixes: CID1396258 Dereference null return value

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-03 18:03:35 +02:00
James Almer
8c2c0135e5 avformat: add a concat protocol that takes a line break delimited list of resources
Suggested-by: ffmpeg@fb.com
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-02 10:21:06 -03:00
Vadym Bezdushnyi
b74beba9a9 avformat/movenc: Support encryption of H.265 stream in AnnexB format
Steps to test:

1. Create h265 test files - mp4 and h265 AnnexB streams:
ffmpeg -f lavfi -i testsrc=duration=10:size=640x480:rate=30 -c:v hevc input_h265.mp4
ffmpeg -f lavfi -i testsrc=duration=10:size=640x480:rate=30 -c:v hevc -bsf:v hevc_mp4toannexb input_h265.h265

2. Encrypt and decrypt files. Put appropriate input file name here: input_h265.mp4 or input_h265.h265
ffmpeg -i input_h265.h265 -vcodec copy -acodec copy -encryption_scheme cenc-aes-ctr \
 -encryption_key 00000000000000000000000000000000 -encryption_kid 00000000000000000000000000000000 \
 encrypted_h265.mp4
ffplay -i encrypted_h265.mp4  -decryption_key 00000000000000000000000000000000

Signed-off-by: Vadym Bezdushnyi <vadim.bezdush@gmail.com>
2021-06-29 18:20:17 +05:30
Robert Bengtsson-Ölund
ad06929d8d avformat/http: Stop cookie_dict leaking on errors.
This solves the memory leak reported in https://trac.ffmpeg.org/ticket/9273

Signed-off-by: Robert Bengtsson-Ölund <robert.bengtsson-olund@intinor.se>
2021-06-26 20:17:57 +02:00
Nick Ruff
ea24781a9b lavf/rtmp: Add option to set TCP_NODELAY for rtmp
Suggested-By: ffmpeg@fb.com
2021-06-20 22:45:35 +02:00
Matthieu Patou
52795d7f09 lavf/webmdashenc.c: Allow AV1 video in WebM
Suggested-By: ffmpeg@fb.com
2021-06-20 22:30:38 +02:00
Michael Niedermayer
602bbf71f6 avformat/aaxdec: Check avio_seek() in header reading
Fixes: Timeout
Fixes: 32450/clusterfuzz-testcase-minimized-ffmpeg_dem_AAX_fuzzer-4875522262827008

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-20 17:43:47 +02:00
Michael Niedermayer
06d174e289 avformat/rmdec: Check old_format len for overflow
Maybe such large values could be disallowed earlier and closer to where
they are set.

Fixes: signed integer overflow: 538976288 * 8224 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-6704350354341888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
fe12aa6890 avformat/realtextdec: Check the pts difference before using it for the duration computation
Fixes: signed integer overflow: 5404200000 - -9223372031709351616 cannot be represented in type 'long'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_REALTEXT_fuzzer-6737340551790592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
1b865cc703 avformat/qcp: Avoid negative nb_rates
Fixes: signed integer overflow: 2 * -1725947872 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_QCP_fuzzer-6726807632084992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
88fc295838 avformat/pp_bnk: Use 64bit in bitrate computation
Fixes: signed integer overflow: 1207959552 * 4 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_PP_BNK_fuzzer-6747301169201152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
1ca00b5e44 avformat/nutdec: Check tmp_size
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_NUT_fuzzer-6739990530883584

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
a1a277926b avformat/msf: Check that channels doesnt overflow during extradata construction
Fixes: signed integer overflow: 2048 * 1122336 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MSF_fuzzer-6726959600107520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
e7a990164f avformat/subtitles: Check pts difference before use
Fixes: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MPL2_fuzzer-6747053545881600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
8ef25d1182 avformat/mpc8: Check for position overflow in mpc8_handle_chunk()
Fixes: signed integer overflow: 15 + 9223372036854775796 cannot be represented in type 'long'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-6723520756318208
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-6739833034768384

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
ff05326081 avformat/mccdec: Fix overflows in num/den
Fixes: signed integer overflow: 6365816 * 1000 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MCC_fuzzer-6737934184218624

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
93d964689c avformat/iff: Use 64bit in duration computation
Fixes: signed integer overflow: 588 * 16719904 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-6748331936186368

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
6ea494befc avformat/dxa: Check fps to be within the supported range more precissely
Fixes: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself
Fixes: assertion failure
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_DXA_fuzzer-6744985740378112

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
b72d657b73 avformat/tta: Check for EOF in index reading loop
Fixes: OOM
Fixes: 33585/clusterfuzz-testcase-minimized-ffmpeg_dem_TTA_fuzzer-4564665830080512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-18 18:58:25 +02:00
Kevin LaFlamme
7d1464721e dashenc: Write out DASH manifest immediately in streaming mode
When streaming mode is enabled with fMP4/CMAF for DASH output, the
segment files are available to read by players as soon as the first byte
is written instead of only after the file is fully written. The DASH
manifest currently only gets written when the final write to the segment
file occurs. This means that players cannot stream the first segment
while it is being written.

When -lhls is enabled with MP4 segments the HLS manifest is written
immediately to advertise the in-flight segments. This change adds the
same behavior for the DASH manifest so players can stream it
immediately.
2021-06-14 21:47:09 +05:30
Limin Wang
f21626b67b avformat/dashenc: use av_match_ext()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-06-14 21:11:24 +05:30
Valerii Zapodovnikov
91ba771a3f avformat/mxfdec: fixed jp2k_rsiz and 170M matrix
Again. 240M matrix is different from BT.601! And 170M is the same
as BT.601. It is primaries that are the same in 240M and 170M, as
for jp2k_rsiz see page 17 of ST 422:2019. IT WAS THERE since 2006.
This wrong jp2k_rsiz is a copy-paste of header_open_partition_key.
2021-06-13 22:04:14 +02:00
Michael Niedermayer
480f11bdd7 avformat/rpl: The associative law doesnt hold for signed integers in C
Add () to avoid undefined behavior
Fixes: signed integer overflow: 9223372036854775790 + 57 cannot be represented in type 'long'
Fixes: 34983/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-5765822923538432

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-12 14:22:42 +02:00
Michael Niedermayer
ffe4851e23 avformat/utils: Avoid overflow in codec_info_duration computation for subtitles
Fixes: signed integer overflow: 9223126845747118112 - -2594073385365397472 cannot be represented in type 'long'
Fixes: 34936/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-6739888002170880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-12 14:22:42 +02:00
Michael Niedermayer
bf4e7ec825 avformat/utils: check dts/duration to be representable before using them
Fixes: signed integer overflow: 6854513951393103890 + 3427256975738527712 cannot be represented in type 'long'
Fixes: 32936/clusterfuzz-testcase-minimized-ffmpeg_dem_R3D_fuzzer-5236914752978944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-12 14:22:42 +02:00
Michael Niedermayer
f54d85cee6 avformat/mov: Check for duplicate mdcv
Fixes: memleak
Fixes: 34932/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5456227658235904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-12 14:22:42 +02:00
Michael Niedermayer
1e24da5cfe avformat/flvdec: Check data before casting
Fixes: -nan is outside the range of representable values of type 'long'
Fixes: signed integer overflow: 1000 * -9223372036854775808 cannot be represented in type 'long'
Fixes: 34890/clusterfuzz-testcase-minimized-ffmpeg_dem_FLV_fuzzer-5334208657620992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-12 14:22:42 +02:00
Anton Khirnov
71c0ef882e lavf: clarify probesize/format_probesize doxy
probesize is not used for probing the input format, but its
documentation claims it does.
2021-06-11 19:42:24 +02:00
James Almer
2cccab96f6 avformat: make AVStream.pts_wrap_bits public
It can be useful to library users, and is currently being used by ffmpeg.c

Suggested-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-06-10 18:37:26 -03:00
zheng qian
f38458089f avformat/mpegtsenc: enable muxing of ARIB captions
Writes a general ARIB stream identifier descriptor, as well
as a data component descriptor which also includes a
pre-defined additional_arib_caption_info structure.

Signed-off-by: zheng qian <xqq@xqq.im>
2021-06-10 23:16:55 +03:00
Anton Khirnov
1256b71ba9 lavf/mp3dec: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
c9642265f8 lavf/mov_chan: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
823ca1ba84 lavf/matroska: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
f3dafe6a41 lavf/latmenc: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
e246625b01 lavf/id3v1: drop unnecessary avcodec.h include 2021-06-10 16:51:44 +02:00
Anton Khirnov
5620d18e66 lavf/hevc: drop unnecessary avcodec.h include 2021-06-10 16:51:44 +02:00
Anton Khirnov
f79d009b7c lavf/framecrcenc: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
239b7d2e40 lavf/adtsenc: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
e7196afe28 lavf/a64: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
e67e02d156 lavf/avformat.h: drop the avcodec.h include
Since AVStream.codec is gone, avformat.h does not require anything from
avcodec.h.
2021-06-10 16:51:44 +02:00
Anton Khirnov
51200769c3 lavf/icoenc: include required headers explicitly 2021-06-10 16:51:44 +02:00
Anton Khirnov
c4c6c83421 lavf/internal: include avcodec.h explicitly
Do not depend on avformat.h to provide it.
2021-06-10 16:51:44 +02:00
James Almer
591b88e678 avformat: move AVStream.{first,cur}_dts to AVStreamInternal
They are private fields, no reason to have them exposed in a public header.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-06-09 13:55:25 -03:00
James Almer
c768233293 avformat/utils: make ff_update_cur_dts() shared
libavdevice needs it.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-06-09 13:55:25 -03:00
Zhao Zhili
58614f7bee avformat/libsrt: workaround conflict with ffmpeg cmdline option
Add 'srt_streamid' option as an alias for 'streamid'.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-06-09 00:09:33 +02:00
Zhao Zhili
55c54ff744 avformat/libsrt: add tsbpd option
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-06-09 00:07:10 +02:00
Zhao Zhili
9099046cc7 avformat/libsrt: send message in order
There is no good use case for out of order delivery of data. For live
streaming with TSBPD enabled by default, the receiver get data in order
based on the timestamps. However, if TSBPD is disabled, the data can
be delivered out of order.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-06-09 00:07:10 +02:00
Valerii Zapodovnikov
812f39ee85 Revert "avformat/dashenc: Disable writing CODECS tag for HEVC streams"
This reverts commit d6d407d2d7.
Hack not needed after a2b1dd0ce3.
Will fix #7480 and #8904.
This will include e.g. CODECS="hvc1.2.4.L123.B0" into m3u8.

Signed-off-by: Valerii Zapodovnikov <val.zapod.vz@gmail.com>
2021-06-08 22:59:26 +05:30
Michael Niedermayer
a0a4a527c3 avformat/rpl: Check for EOF and zero framesize
Fixes: Infinite loop
Fixes: 34751/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-5439330800762880
Fixes: 34774/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-5851571660390400

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-08 18:00:05 +02:00
Michael Niedermayer
29b244ffc1 avformat/rpl: Use 64bit in bitrate computation and check it
Fixes: signed integer overflow: 777777776 * 4 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-6726188921913344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-05 16:59:37 +02:00
Gyan Doshi
071930de72 avformat/mov: add option to use tfdt for fragment timestamps. 2021-06-02 10:46:04 +05:30
Joel Linn
127c40c9ca avcodec/movenc: fix spelling in warning message
hldr -> hdlr
2021-06-01 23:49:35 +05:30
Przemysław Sobala
575e52272d lavf/dashenc.c: Fix creating audio-only HLS playlists
With audio/video HLS playlists, audio chunklists are treated as
alternative renditions for video chunklists. This is wrong for
audio-only HLS playlists.

fixes: 9252
2021-06-01 11:58:26 +05:30
Gyan Doshi
51f1194eda avformat/hls: relay format options to segment demuxer
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2021-05-30 09:21:19 +05:30
Michael Niedermayer
4c1afa2925 avformat/movenc: Check pal_size before use
Fixes: assertion failure
Fixes: out of array read
Fixes: Ticket8190
Fixes: CVE-2020-22015

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-29 20:14:24 +02:00
Michael Niedermayer
f8611ae1ef avformat/avio: Check av_opt_copy() for failure
Fixes: CID1477416 Unchecked return value

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-27 17:41:36 +02:00
Michael Niedermayer
36a3a5050a avformat/moflex: Remove unneeded format variable
Fixes: CID1477423 Uninitialized scalar variable

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-27 17:41:04 +02:00
Anton Khirnov
9d4c018497 avio: do not export avpriv_io_{move,delete}
They are private and not used by anything outside of lavf. There is no
reason for them to be exported.
2021-05-22 15:27:55 +02:00
Ubaldo Porcheddu
36b16a30db avformat/mpegtsenc: add NIT support
With some minor changes by Marton Balint:
 - removed trailing whitespace
 - fixed network_descriptors_length
 - fixed reserved_future_use flag in the start of the section
 - removed unused program variable
 - emit first NIT after PAT
 - some other cosmetics

Signed-off-by: Ubaldo Porcheddu <ubaldo@eja.it>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-05-20 23:07:46 +02:00
Marton Balint
f597041d57 avformat/flvdec: use milisecond precision for parsing timestamps
Also use helper function to set the timestamp. Maybe we could also use
nanosecond precision, but there were some float rounding concerns.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-05-20 20:39:14 +02:00
Valerii Zapodovnikov
ab658db4d0 libavformat/hlsenc: fix typos in comments 2021-05-20 09:25:15 +05:30
Michael Niedermayer
3e44bd068f avformat/fifo: check for flushed packets and timeshift
Fixes: CID1464151 Dereference after null check

Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-18 19:11:50 +02:00
James Almer
a42d249c91 avformat/framecrcenc: print basic side data information again
This partially reverts c6ae560a18.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-18 10:18:49 -03:00
Steven Liu
59032494e8 Revert "avformat/hlsenc: compute video_keyframe_size after write keyframe"
This reverts commit b5ca8f2c66.

This commit will make new problem about tickets: 9193,9205
It flush data into file with init file context together,
and it can get keyframe size, maybe need more method to get keyframe
size.

Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
2021-05-15 15:27:58 +08:00
Andreas Rheinhardt
6ff2aba088 avformat/utils: Fix NPD when allocating AVStreamInternal fails
Regression since b9c5fdf6027010d15ee90a43aa023e45a5189097;
fixes Coverity ID #1484786.

Also remove the check for st->internal->parser as av_parser_close(NULL)
is a no-op.

Reviewed-by: James Almer <jamrial@gmail.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-13 22:50:53 +02:00
Peter Ross
b5ea0980c5 fix broken links to msdn documentation
Signed-off-by: Peter Ross <pross@xvid.org>
2021-05-13 09:13:03 +10:00
Michael Niedermayer
9548dc74d8 avformat/mov: Ignore duplicate CoLL
Fixes: memleak
Fixes: 32146/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5377612845285376

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-12 23:00:07 +02:00
Michael Niedermayer
299a56c900 avformat/mov: Limit nb_chapter_tracks to input size
Fixes: Timeout (15k loop iterations instead of 400m)
Fixes: 31368/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6601583174483968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-12 23:00:07 +02:00
Michael Niedermayer
578633fc1a avformat/utils: Use 64bit earlier in r_frame_rate check
Fixes: signed integer overflow: 1406796319 * 2 cannot be represented in type 'int'
Fixes: 32777/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5632576913014784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-12 23:00:07 +02:00
Anton Khirnov
6a9a4f34bd lavf/flvdec: normalize exporting date metadata
Export them in UTC, not the local timezone. This way the output is
the same everywhere. The timezone information stored in the file is
still ignored, since there seems to be no simple way to export it
correctly.

Format them according to ISO 8601, which we generally use for exporting
dates.

Fixes fate-flv-demux, which was broken since
958bea5248 on some platforms.
2021-05-12 20:19:02 +02:00
Zane van Iperen
dcb285d2b7
avformat: add Argonaut Games CVG muxer
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-05-12 20:27:02 +10:00
Zane van Iperen
9789ea59d0
avformat: add Argonaut Games CVG demuxer
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-05-12 20:25:50 +10:00
Anton Khirnov
c6ae560a18 lavf/framecrcenc: do not hash side data
There are no guarantees that all side data types have the same
representation on all platforms.

Tests that change output due to this:

id3v2-priv-remux, cover-art-mp3-id3v2-remux, gapless-mp3: SKIP_SAMPLES,
which is tested by fate-gapless-mp3-side-data

matroska-vp8-alpha-remux: MATROSKA_BLOCKADDITIONAL, which is tested by
remux itself (side data is written into output)

matroska-mastering-display-metadata: MASTERING_DISPLAY_METADATA and
CONTENT_LIGHT_LEVEL, which are tested by ffprobe invocation in the same
test

matroska-spherical-mono-remux: STEREO3D and SPHERICAL, which are tested
by ffprobe invocation in the same test

segment-mp4-to-ts: MPEGTS_STREAM_ID, which is tested by ts remuxing
tests

webm-webvtt-remux: WEBVTT_IDENTIFIER/SETTINGS, which is tested by the
ffprobe invocation in the same test

mxf-d10-user-comments: CPB_PROPERTIES, which is tested by mxf-probe-d10

mov-cover-image: SKIP_SAMPLES, which is tested for mov by
mov-aac-2048-priming

copy-trac3074: AUDIO_SERVICE_TYPE, which is tested by fate-hls-fmp4_ac3
2021-05-09 11:07:20 +02:00
Cameron Cawley
bc86515c4f
avformat/rpl: Support files containing Replay IMA ADPCM audio
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-05-09 17:01:34 +10:00
Jan Ekström
ffd1316e44 avformat/matroskadec: remove special handling of av1c extradata
Libavcodec can now handle the standard AV1CodecConfigurationRecord
extradata as-is.
2021-05-08 15:27:00 +03:00
Jan Ekström
45e3b6a68b avformat/mov: remove special handling of av1c extradata
Libavcodec can now handle the AV1CodecConfigurationRecord structure
as-is when passed as extradata, so the standard behavior of
read-box-into-extradata should suffice, just like with AVC and HEVC.
2021-05-08 15:27:00 +03:00
Limin Wang
eb390d7f9d avformat/hls: use av_strncasecmp()
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-05-07 23:23:23 +08:00
James Almer
f140239777 avformat: move AVStream.stream_identifier to AVStreamInternal
It's a private field, no reason to have it exposed in a public header.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-07 09:27:22 -03:00
James Almer
7489f63281 avformat: move AVStream.codec_info_nb_frames to AVStreamInternal
It's a private field, no reason to have it exposed in a public header.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-07 09:27:21 -03:00
James Almer
b9c5fdf602 avformat: move AVStream.{parser,need_parsing} to AVStreamInternal
Those are private fields, no reason to have them exposed in a public
header.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-07 09:27:21 -03:00
James Almer
fab2ed4704 avformat: move AVStream.probe_packets to AVStreamInternal
It's a private fields, no reason to have it exposed in a public header.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-07 09:27:20 -03:00
James Almer
1262f67cca avformat: move AVStream.last-IP_{pts,duration} to AVStreamInternal
Those are private fields, no reason to have them exposed in a public
header.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-07 09:27:20 -03:00
James Almer
74dce63f9a avformat/utils: constrain the lifetime of the pointer returned by avformat_index_get_entry()
This will give us more room to improve the implementation later.

Suggested-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-06 15:26:56 -03:00
James Almer
55475b3289 avformat/mov: don't save a copy of the packet's AVBufferRef on DV streams
It's no longer needed.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-06 09:44:42 -03:00
James Almer
42895f590a avformat/avidec: don't save a copy of the packet's AVBufferRef on DV streams
It's no longer needed.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-06 09:44:42 -03:00
James Almer
57aaeff523 avformat/dv: stop using av_init_packet()
Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-06 09:44:42 -03:00
Zane van Iperen
2329f7f21e
avformat/rpl: cosmetics
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-05-06 11:06:43 +10:00
Gyan Doshi
8ab2bb81b2 avformat/hlsenc: correct log text and supply packet details 2021-05-05 20:26:38 +05:30
Michael Niedermayer
0ff60249a5 avformat/mvdec: Check sample rate in parse_audio_var()
Fixes: signed integer overflow: -635424002382840000 * 16 cannot be represented in type 'long'
Fixes: 33612/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5704741108711424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-04 17:55:24 +02:00
Justin Ruggles
c75dfa0435 movenc: add movie_timescale option instead of hardcoding 1000
There are cases where using 1000 as the MP4 timescale is not
accurate enough, for example when one needs sample-accurate audio
handling.

This adds a new AVOption to the MOV/MP4 muxer to override the
movie timescale, but it still defaults to 1000 to maintain current
default behavior.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2021-05-04 15:32:26 +02:00
Andreas Rheinhardt
4796ec5d4e avformat/dump: Remove remnants of codec timebase
Fixes Coverity issue #1477414.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-30 10:21:29 +02:00
zheng qian
86a71d897f avformat/mpegtsenc: Fix indentation inside if-clause in mpegts_write_pes()
Fix indentation caused by the added stream_id check.

Signed-off-by: zheng qian <xqq@xqq.im>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-28 21:35:46 +02:00
zheng qian
6ad61e30a1 avformat/mpegtsenc: Fix mpegts_write_pes() for private_stream_2 and other types
According to the PES packet definition defined in Table 2-17 of ISO_IEC_13818-1
specification, some fields like PTS/DTS or pes_extension could only appears if
the stream_id meets the condition:

if (stream_id != 0xBC &&  // program_stream_map
    stream_id != 0xBE &&  // padding_stream
    stream_id != 0xBF &&  // private_stream_2
    stream_id != 0xF0 &&  // ECM
    stream_id != 0xF1 &&  // EMM
    stream_id != 0xFF &&  // program_stream_directory
    stream_id != 0xF2 &&  // DSMCC_stream
    stream_id != 0xF8)    // ITU-T Rec. H.222.1 type E stream

And the following stream_id types don't have fields like PTS/DTS:

else if ( stream_id == program_stream_map
|| stream_id == private_stream_2
|| stream_id == ECM
|| stream_id == EMM
|| stream_id == program_stream_directory
|| stream_id == DSMCC_stream
|| stream_id == ITU-T Rec. H.222.1 type E stream ) {
    for (i = 0; i < PES_packet_length; i++) {
        PES_packet_data_byte
    }
}

Current implementation skipped the check of stream_id causing some kind of
streams like private_stream_2 to be incorrectly written with actually a
private_stream_1-like PES header with PTS/DTS field. For example, Japan DTV
transmits news and alerts through ARIB superimpose that utilizes
private_stream_2 still could not be remuxed correctly for now.

This patch set fixes the remuxing for private_stream_2 and
other stream_id types.

Signed-off-by: zheng qian <xqq@xqq.im>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-28 21:32:22 +02:00
zheng qian
f01286957e avformat/mpegts: Fix indentation for stream_id constants
Signed-off-by: zheng qian <xqq@xqq.im>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-28 21:24:45 +02:00
zheng qian
f4df5039a7 avformat/mpegts: Add missing constants for MPEG-TS stream_id definitions
Signed-off-by: zheng qian <xqq@xqq.im>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-28 21:24:45 +02:00
Marton Balint
3f27021143 avformat/mpegtsenc: factorize determining pes stream id
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-28 21:24:44 +02:00
Marton Balint
b9fff6e15e avformat/mpegtsenc: move is_dvb_subtitle/is_dvb_teletext initialization upwards
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-04-28 21:24:44 +02:00
Andreas Rheinhardt
bc70684e74 avformat: Constify all muxer/demuxers
This is possible now that the next-API is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:06 -03:00
Anton Khirnov
85ba17f36d Bump major versions of all libraries.
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-27 11:48:05 -03:00
James Almer
0bf3a7361d avutil: remove deprecated AVClass.child_class_next
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:04 -03:00
James Almer
3749eede66 avformat: remove deprecated AVStream.codec
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:47:24 -03:00
Andreas Rheinhardt
46dac8cf3d avformat/avformat, utils: Make av_find_best_stream const-correct
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:14 -03:00
Andreas Rheinhardt
14fa0a4efb avformat/avformat: Constify AVFormatContext.*_codec pointers
This also allows to exclusively use pointers to const AVCodec in
fftools/ffmpeg_opt.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt
ef6a9e5e31 avutil/buffer: Switch AVBuffer API to size_t
Announced in 14040a1d91.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt
e83717e63e avformat: Switch AVChapter.id to 64bits
Announced in e318438f2f.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:10 -03:00
Andreas Rheinhardt
0a071f7124 avformat: Remove deprecated av_demuxer_open()
Deprecate in e37f161e66.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:10 -03:00
Andreas Rheinhardt
e8876bdcf3 avformat: Remove deprecated AVFMT_FLAG_MP4A_LATM flag, latm option
Deprecated in 67747c89ad.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
e5bcda6473 avformat/dashenc: Remove deprecated min_seg_duration option
Deprecated in 01ba52852d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
6f34f03190 avformat/rtsp: Remove deprecated old options, rename stimeout->timeout
Deprecated in ff46124b0d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
252500a78f avformat/aviobuf: End grace period of allowing 0 from read_packet
See a606f27f4c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
7b6012efaa avformat/mov, movenc: Stop exporting rotation via metadata
Deprecated in ddef3d902f.

(The reference file of the mov-zombie test needed to be updated, because
a rotate metadata tag is no longer exported; the side-data is of course
still present.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
a3439de874 avformat: Remove remnants of side data merging
Deprecated in d682ae70b4,
ineffective since ca4df37f06.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
2086d635c3 avformat/hlsenc: Remove deprecated localtime options
Deprecated in fbd8746efa.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
41181bc4a0 avformat/hlsenc: Remove deprecated wrap option
Deprecated in d96ebc5ef8.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
dc8e15ef15 avformat/http: Remove deprecated "user-agent" option
Deprecated in 27714b462d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
11cb635c84 avformat/avformat: Remove outdated private fields
Affected function pointers (always NULL) in AVInputFormat,
AVOutputFormat as well as private fields of AVStream.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
30f7021aa0 avformat: Remove deprecated filename field from AVFormatContext
Deprecated in fa8308d3d4.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
704017d91e avformat: Remove getters and setters
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:09 -03:00
Andreas Rheinhardt
119ebd642a avformat: Remove deprecated old open callbacks
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:08 -03:00
Andreas Rheinhardt
131f2c2712 avformat: Remove FFserver leftovers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:08 -03:00
Andreas Rheinhardt
56450a0ee4 avformat: Constify the API wrt AV(In|Out)putFormat
Also constify AVProbeData.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:08 -03:00
Andreas Rheinhardt
f0c7fa2c48 avcodec: Switch AVCPBProperties to 64bits
Announced in 2e8b0446c6.
Two FATE-tests needed to be updated because the checksums of
side data containing an AVCPBProperties struct changed.

buffer_size has also been switched to 64bits because it is a bitsize.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:07 -03:00
Andreas Rheinhardt
df6b44182e avcodec, avformat: Remove AVPacket.convergence_duration
Deprecated in 948f3c19a8.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:00 -03:00
Andreas Rheinhardt
0f247986ad avcodec, avformat: Remove old BSF API
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:42:59 -03:00
Andreas Rheinhardt
1137ddf330 avformat: Remove next API for AV(In|Out)putFormat
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:42:59 -03:00
Gyan Doshi
b06082d1d5 avformat/dtsenc: reindent 2021-04-27 09:21:43 +05:30
Gyan Doshi
45fc214ebf avformat/adtsenc: clarify option help
Also remove unnecessary unit as option does not accept any constants.
2021-04-27 09:18:41 +05:30
Andreas Rheinhardt
cc7943e803 avformat/westwood_audenc: Remove unused variable
Reviewed-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-26 16:46:37 +02:00
Andreas Rheinhardt
a64d4de0d4 avformat/westwood_audenc: Check for, not assert on invalid data
Reviewed-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-26 16:46:37 +02:00
Jan Ekström
464d6ed98d avformat/ttmlenc: enable writing out additional header values
This way the encoder may pass on the following values to the muxer:
1) Additional root "tt" element attributes, such as the subtitle
   canvas reference size.
2) Anything before the body element of the document, such as regions
   in the head element, which can configure styles.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2021-04-26 16:40:31 +03:00
Aidan Richmond
4236e87f50
avformat/westwoodaudenc: Adds muxer for Westwood AUD format.
Format is still used by modders of these old games.

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Aidan Richmond <aidan.is@hotmail.co.uk>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-04-26 19:56:33 +10:00
Chris Ribble
c9fed043f1 libavformat/adtsenc: Increase ADTS_MAX_FRAME_BYTES from 8k to 16k
ADTS frames may contain up to 768 bytes per channel. With 16 channels,
this is 12k, which cannot fit into the maximum 8k buffer.

Signed-off-by: Chris Ribble <chris.ribble@resi.io>
2021-04-25 19:16:40 +02:00
Michael Niedermayer
098314e1e5 avformat/asfdec_o: Use ff_get_extradata()
Fixes: OOM
Fixes: 27240/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-5937469859823616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-04-24 11:36:47 +02:00
Michael Niedermayer
efdb564504 avformat/id3v2: Check end for overflow in id3v2_parse()
Fixes: signed integer overflow: 9223372036840103978 + 67637280 cannot be represented in type 'long'
Fixes: 33341/clusterfuzz-testcase-minimized-ffmpeg_dem_DSF_fuzzer-6408154041679872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-04-23 11:35:40 +02:00