1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

20220 Commits

Author SHA1 Message Date
James Almer
a447b75de8 avformat: replace all uses of av_copy_packet()
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-25 21:26:38 -03:00
Martin Vignali
45c15b7490 libavformat : add mov dataformat tag for HapAlphaOnly and HapQAlpha
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-24 21:54:13 +02:00
Jörn Heusipp
3d2da6d585
avformat/libopenmpt: Query duration and metadata after selecting subsong
Duration depends on the selected subsong and thus must be queried after
selecting the subsong. There is no compelling reason to query other
metadata earlier either.

Tested with libopenmpt version: 0.2.8760-beta27
Libopenmpt configure options: --without-ogg --without-vorbis
--without-vorbisfile --without-portaudio --without-portaudiocpp
--without-mpg123 --without-pulseaudio --without-sndfile --without-flac

Signed-off-by: Jörn Heusipp <osmanx@problemloesungsmaschine.de>
Signed-off-by: Josh de Kock <josh@itanimul.li>
2017-09-24 15:54:38 +01:00
James Almer
86be73c7c1 avformat/mpeg: zero initialize idx_pkt
Prevents use of uninitialized stack.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-23 19:37:21 -03:00
Marton Balint
01911b9b3c avformat/mxfdec: use the common packet pts setter function for opatom files
Fixes ticket #6631.

Signed-off-by: Marton Balint <cus@passwd.hu>
2017-09-23 19:07:54 +02:00
Marton Balint
7f80b065a6 avformat/mxfdec: factorize packet pts setter function
Signed-off-by: Marton Balint <cus@passwd.hu>
2017-09-23 19:07:54 +02:00
James Almer
afe674734b avformat/gif: use av_packet_alloc()
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-23 02:18:47 -03:00
James Almer
bb4b7624d9 avformat/apngenc: use av_packet_alloc()
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-23 02:18:36 -03:00
Lou Logan
183fd30e0f Fix several typos
"apix_fmts" found by Marc Péchaud.
"speedloss" found by Mikhail V.

Signed-off-by: Lou Logan <lou@lrcd.com>
2017-09-21 16:17:02 -08:00
Carl Eugen Hoyos
724cf83f10 Remove some unneeded casts of bit_rate. 2017-09-22 01:33:22 +02:00
Steven Liu
c34c0e3a64 avformat/hlsenc: support http method for hls fmp4 init file
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-09-21 23:10:57 +08:00
Steven Liu
7e9cdd3f49 avformat/hlsenc: fix CID 1418106
fix the "Uninitialized scalar variable (UNINIT)" problem.

Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-09-21 23:08:00 +08:00
Tatsuyuki Ishi
598e416840 GnuTLS: eat PREMATURE_TERMINATION error
GnuTLS is too strict on the SSL shutdown alert, and it's neither
mandatory in the spec or critical. As it's ignored in OpenSSL, we
should also suppress it in GnuTLS as well.

Ticket: #6667

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-21 03:02:24 +02:00
Anton Khirnov
5a3b602acd avformat/cafdec: reject multichannel Opus streams
Multichannel Opus streams require channel mapping information in extradata.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-19 23:06:42 -03:00
Carl Eugen Hoyos
b4093e60c5 lavf/caf: Support demuxing Opus.
Introduced in macOS High Sierra and iOS 11.
2017-09-20 03:31:48 +02:00
Carl Eugen Hoyos
ca72cd137d lavf/mpegts: Consider stream_type 0x0f just a hint towards AAC.
It is also used in the wild to signal latm.

Fixes ticket #6657.
2017-09-20 02:20:32 +02:00
Carl Eugen Hoyos
2f3a3a7e32 lavf/utils: Do not force chapter end time before chapter start.
Fixes ticket #6671.
2017-09-20 00:57:29 +02:00
Tobias Rapp
3ffd3b7f5f avformat/mxfenc: cosmetic changes
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2017-09-18 08:57:09 +02:00
Tobias Rapp
35d6be199a avformat/mxfenc: fix aspect ratio when writing 16:9 DV frames
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2017-09-18 08:56:28 +02:00
Aman Gupta
73bf0f42e3 avformat/hlsenc: fix segfault when using -hls_segment_type fmp4 with -hls_segment_filename
previously, specifying -hls_segment_filename meant
s->base_output_dirname was never set, causing a segfault:

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
* frame #0: 0x00007fffbf7d82d0 libsystem_platform.dylib`_platform_strcmp + 80
frame #1: 0x00000001005f4dcf libavformat.57.dylib`io_open_default(s=0x000000010481cc00, pb=0x0000000104806020, url=0x0000000000000000, flags=2, options=0x0000000000000000) at options.c:107
frame #2: 0x0000000100528968 libavformat.57.dylib`hls_mux_init(s=0x000000010481cc00) at hlsenc.c:595
frame #3: 0x00000001005273cb libavformat.57.dylib`hls_write_header(s=0x000000010481cc00) at hlsenc.c:1518
frame #4: 0x00000001005c08d0 libavformat.57.dylib`write_header_internal(s=0x000000010481cc00) at mux.c:486
frame #5: 0x00000001005c0774 libavformat.57.dylib`avformat_write_header(s=0x000000010481cc00, options=0x00000001029026e8) at mux.c:539
2017-09-16 10:32:28 +08:00
Clément Bœsch
6743351558 lavf/http: fix compilation without zlib
Regression since e2f8f14052.
2017-09-15 15:10:49 +02:00
Jacek Jendrzej
e2f8f14052 lavf/http: Reset compressed header flag, fix http 302 request
Fixes ticket #6404.
Fixes ticket #6666.

Signed-off-by: Jacek Jendrzej <satbaby@kawaii.com>
2017-09-15 13:33:23 +02:00
Paras Chadha
6ce4a635ed avformat/fitsenc: fill header line with spaces
Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-12 21:39:57 -03:00
Michael Niedermayer
de03eb622d avformat/mxfenc: Correct the Sample rate for PCM outside D10
Based on mail from IRT

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-12 19:24:25 +02:00
Michael Niedermayer
4c33ec004f avformat/mxfenc: Comment edit rate write code like the surrounding code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-12 19:24:25 +02:00
Michael Niedermayer
4c88087f93 avformat/mxfenc: Replace more literal magic numbers by enum values.
This also moves the enum table up as it is needed earlier

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-12 19:24:25 +02:00
Petri Hintukainen
7a6bd54152 Add SUP/PGS subtitle muxer
Fixes ticket #2208
2017-09-09 12:07:14 +02:00
Steven Liu
ab96e2ca81 avformat/dashdec: free resource allocated by xml
modify from av_free to xmlFree

Suggested-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-09-09 08:34:07 +08:00
Steven Liu
96d70694ae avformat/dashdec: add dash demuxer base version
ffmpeg need a dash demuxer for demux the dash formats base on
https://github.com/samsamsam-iptvplayer/exteplayer3/blob/master/tmp/ffmpeg/patches/3.2.2/000001_add_dash_demux.patch

TODO:
1. support multi bitrate dash.

v2 fixed:
1. from autodetect to disabled
2. from camelCase code style to ffmpeg code style
3. from RepType to AVMediaType
4. fix variable typo
5. change time value from uint32_t to uint64_t
6. removed be used once API
7. change 'time(NULL)`, except it is not 2038-safe.' to av_gettime and av_timegm
8. merge complex free operation to free_fragment
9. use API from snprintf to av_asprintf

v3 fixed:
1. fix typo from --enabled-xml2 to --enable-xml2

v4 fixed:
1. from --enable-xml2 to --enable-libxml2
2. move system includes to top
3. remove nouse includes
4. rename enum name
5. add a trailing comma for the last entry enum
6. fix comment typo
7. add const to DASHContext class front
8. check sscanf if return arguments and give warning message when error
9. check validity before free seg->url and seg
10. check if the val is null, before use atoll

v5 fixed:
1. fix typo from mainifest to manifest

v6 fixed:
1. from realloc to av_realloc
2. from free to av_free

v7 fixed:
1. remove the -lxml2 from configure when require_pkg_config

v8 fixed:
1. fix replace filename template by av_asprintf secure problem

v9 modified:
1. make manifest parser clearly

v10 fixed:
1. fix function API name code style
2. remove redundant strreplace call
3. remove redundant memory operation and check return value from get_content_url()
4. add space between ) and {
5. remove no need to log the value for print

v11 fixed:
1. from atoll to strtoll
Suggested-by: Michael Niedermayer <michael@niedermayer.cc>

v12 fixed:
1. remove strreplace and instead by av_strreplace
Suggested-by: Nicolas George <george@nsup.org>

v13 fixed:
1. fix bug: cannot play:
http://dash.edgesuite.net/akamai/bbb_30fps/bbb_30fps.mpd
Reported-by: Andy Furniss <adf.lists@gmail.com>

v14 fixed:
1. fix bug: TLS connection was non-properly terminated
2. fix bug: No trailing CRLF found in HTTP header
Reported-by: Andy Furniss <adf.lists@gmail.com>

v15 fixed:
1. play youtube link: ffmpeg -i $(youtube-dl -J "https://www.youtube.com/watch?v=XmL19DOP_Ls" | jq -r ".requested_formats[0].manifest_url")
2. code refine for timeline living stream
Reported-by: Ricardo Constantino <wiiaboo@gmail.com>

v16 fixed:
1. remove the snprintf and instead by get_segment_filename make safety
2. remove unnecessary loops
3. updated xmlStrcmp and xmlFree to av_* functions
4. merge code repeat into one function
5. add memory alloc faild check
6. update update_init_section and open_url
7. output safety error message when filename template not safe
Suggested-by : wm4 <nfxjfg@googlemail.com>

v17 fixed:
1. add memory alloc faild check
2. fix resource space error at free_representation

v18 fixed:
1. add condition of template format

v19 fixed:
1. fix typo of the option describe

v20 fixed:
1. add the c->base_url alloc check
2. make the DASHTmplId same to dashenc

v21 fixed:
1. remove get_repl_pattern_and_format and get_segment_filename
2. process use dashcomm APIs

v22 fixed:
1. modify the include "dashcomm.h" to include "dash.h"
2. use internal API from dash_fill_tmpl_params to ff_dash_fill_tmpl_params

Signed-off-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: samsamsam <samsamsam@o2.pl>
2017-09-09 08:32:03 +08:00
James Almer
27b7800ba9 avformat/matroskaenc: also write tags when output is WebM
WebM supports a subset of elements from the Tags master.
See https://www.webmproject.org/docs/container/#tagging

Reviewed-by: Ivan Janatra <janatra@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-08 20:02:43 -03:00
Michael Niedermayer
afc9c683ed avformat/asfdec: Fix DoS in asf_build_simple_index()
Fixes: Missing EOF check in loop
No testcase

Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-07 15:19:22 +02:00
Michael Niedermayer
9cb4eb7728 avformat/mov: Fix DoS in read_tfra()
Fixes: Missing EOF check in loop
No testcase

Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-07 15:19:22 +02:00
Michael Niedermayer
913feb6263 avformat/gdv: Make FixedSize static
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-07 15:19:22 +02:00
Steven Liu
ef7fe81b85 flvdec: Check the avio_seek return value after reading a metadata packet
merge from libav: 585dc1aece

If the metadata packet is corrupted, flv_read_metabody can accidentally
read past the start of the next packet. If the start of the next packet
had been flushed out of the IO buffer, we would be unable to seek to
the right position (on a nonseekable stream).

Prefer to clearly error out instead of silently trying to read from a
desynced stream which will only be interpreted as garbage.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-09-07 08:30:14 +08:00
Karthick J
837c55e072 avformat/hlsenc: Added configuration to override HTTP User-Agent
Signed-off-by: Karthick J <kjeyapal@akamai.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-09-05 23:30:52 +08:00
Alex Converse
4d2b9ece45 avformat/flvdec: Set need_context_update when setting the initial extradata
Fixes ticket 6398.

Debugged with the help of James Almer and Hendrik Leppkes.
2017-09-03 20:01:39 -07:00
wm4
5d76674756 lavf: make avio_read_partial() public
Main use-case is proxying avio through a foreign I/O layer and a custom
AVIO context, without losing latency and performance characteristics.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Merged from Libav commit 173b56218f.
2017-09-01 17:56:33 +02:00
James Almer
877076ffa1 avformat/avio: update avio_alloc_context() doxy
It must be freed using avio_context_free() starting with commit
b12e4d3bb8.

Found-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-01 12:26:36 -03:00
Steven Liu
adeb41afb8 avformat/dash:add copyright to dash.c
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2017-09-01 18:52:56 +08:00
Anton Khirnov
78a7af823b Use the new AVIOContext destructor.
(cherry picked from commit 6f554521af)
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-01 02:16:33 -03:00
Anton Khirnov
b12e4d3bb8 avio: add a destructor for AVIOContext
Before this commit, AVIOContext is to be freed with a plain av_free(),
which prevents us from adding any deeper structure to it.

(cherry picked from commit 99684f3ae7)
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-01 01:51:15 -03:00
Steven Liu
837580f458 avformat/dash: move reused API to common file and header file
move from dashenc, move DASHTmplId and dash_fill_tmpl_params to
dash.c, they will be used by dash demuxer and dash muxer.

v2 fixed:
1. rename common file from dashcomm.* to dash.*
Suggested-by: Hendrik Leppkes <h.leppkes@gmail.com>

v3 fixed:
1. rename header file pre defined
2. add ff_ prefix for the internal API
Suggested-by: James Almer <jamrial@gmail.com>

Suggested-by: Timo Rothenpieler <timo@rothenpieler.org>
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2017-09-01 10:20:56 +08:00
孙浩(晓黑)
9d00fb9d70 avformat/mxfdec: Fix Sign error in mxf_read_primer_pack()
Fixes: 20170829B.mxf

Co-Author: 张洪亮(望初)" <wangchu.zhl@alibaba-inc.com>
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-01 01:48:39 +02:00
孙浩(晓黑)
900f39692c avformat/mxfdec: Fix DoS issues in mxf_read_index_entry_array()
Fixes: 20170829A.mxf

Co-Author: 张洪亮(望初)" <wangchu.zhl@alibaba-inc.com>
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-01 01:48:35 +02:00
孙浩(晓黑)
c24bcb5536 avformat/nsvdec: Fix DoS due to lack of eof check in nsvs_file_offset loop.
Fixes: 20170829.nsv

Co-Author: 张洪亮(望初)" <wangchu.zhl@alibaba-inc.com>
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-01 01:48:31 +02:00
Daniel Glöckner
feb1dbc7bd avformat/mov: prevent duplication of first fragment's ctts_data
MP4 files with fragments might have the first moof box that is mentioned
in a fragment index before the first mdat box. Since it is then already
parsed by mov_read_header, we have to make sure that mov_switch_root
will not parse it again when seeking by setting the headers_read flag in
the index. Parsing it a second time would cause the ctts_data array to
receive a second copy of the information from the trun box, leading to
wrong PTS values for the second and following fragments in presence of
B-frames.

Fixes ticket 6560.

Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-01 00:56:32 +02:00
Dale Curtis
f1e47f8713 avformat/mov: Bail when invalid sample data is present.
ctts data in ffmpeg relies on the index entries array to be 1:1
with samples... yet sc->sample_count can be read directly from
the 'stsz' box and index entries are only generated if a chunk
count has been read from 'stco' box.

Ensure that if sc->sample_count > 0, sc->chunk_count is too as
a basic sanity check. Additionally we need to check that after
the index is built we have the right number of entries, so we
also check in mov_read_trun() that sc->sample_count ==
st->nb_index_entries.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-01 00:56:32 +02:00
Justin Ruggles
1a0d9b503d avformat/concatdec: add fallback for calculating file duration
If a file does not have a known duration, this leads to the timestamps
starting over for the next file, causing non-monotonic timestamps.
To prevent this, track the duration during demuxing and use it to
determine the current file duration before opening the next file.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2017-08-31 15:33:52 +01:00
Paras Chadha
df475db9a2 Add FITS Muxer
Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
2017-08-30 12:13:02 +02:00
Paras Chadha
207f0cff2a Add FITS Demuxer
Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
2017-08-30 12:13:01 +02:00