summaryrefslogtreecommitdiff
path: root/libavformat/flvdec.c
Commit message (Collapse)AuthorAge
* avformat/flvdec: Avoid duplicating extradata when adding side-dataAndreas Rheinhardt2020-05-28
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: Don't free old extradata before ff_alloc/get_extradataAndreas Rheinhardt2019-12-12
| | | | | | | | These functions already free it themselves before they allocate the new extradata. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: Forward errors where possibleAndreas Rheinhardt2019-12-12
| | | | | | | | | | It is not uncommon to find code where the caller thinks to know better what the return value should be than the callee. E.g. something like "if (av_new_packet(pkt, size) < 0) return AVERROR(ENOMEM);". This commit changes several instances of this to instead forward the actual error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvdec: delete unused codeleozhang2019-08-23
| | | | | | Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com> Signed-off-by: leozhang <leozhang@qiyi.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/flvdec: added support for KUX containerSwaraj Hota2019-04-06
| | | | | | | | Fixes ticket #4519. The metadata starting at 0xe00004 is encrypted with the password "meta" but zlib does not support decryption, so no kux metadata is read.
* lavf/flvdec: Cosmetics: Fix indentation for flv_read_packetJun Zhao2019-03-31
| | | | | | Commit e34ba5ec53b missed the indent Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/flvdec: add AMF date type supportJun Zhao2019-03-31
| | | | | | Support AMF date type when parse the FLV metadata. Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/flvdec: fix typo in log messageJun Zhao2019-03-23
| | | | | | fix typo in log message, it's come from cd141e71bd3 Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-21
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* avformat/flvdec: Try to support some concatenated flv filesMichael Niedermayer2019-01-31
| | | | | | Fixes: discont.flv Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* flvdec: Export unknown metadata packets as opaque dataMartin Storsjö2018-11-05
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: Rename FLV_STREAM_TYPE_DATA into FLV_STREAM_TYPE_SUBTITLEMartin Storsjö2018-11-05
| | | | | | This is always treated as a subtitle at the moment anyway. Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/flvdec: don't propagate empty extradataJames Almer2018-08-24
| | | | | | | Fixes ticket #7379 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/flvdec: add flv_full_metadata option into flvdecSteven Liu2018-08-07
| | | | | | output all the metadata context when use this option. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/flvdec: reindent code for previous commitSteven Liu2018-08-07
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/flvdec: add flv_ignore_prevtag option into flvdecSteven Liu2018-08-07
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/flvdec: Remove an outdated comment.Carl Eugen Hoyos2018-07-25
| | | | The buffer size was increased in b2fecce3 to prepare for 790a3cdf.
* avformat/flvdec: Set broken_sizes for FlixEngine.Nikolas Bowe2018-02-23
| | | | | | | | | | | | | | | we found some very old videos which suffered from corruption after 9e6a2427558a718be0c1fffacffd935f630a7a8d, but were fine before. These had "End of AC stream reached in vp6_parse_coeff" warnings in logs. These also had flv Packet mismatch warnings. Adding FlixEngine to the list of flv muxers which produce broken packet sizes fixes this corruption. FlixEngine is very old and not maintained or available anymore (since 2010), so we won't need to worry about newer versions fixing the issue. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '279e3aaa14daba6b7a37d75f3fb6e29c732d123f'James Almer2017-10-28
|\ | | | | | | | | | | | | * commit '279e3aaa14daba6b7a37d75f3fb6e29c732d123f': flv: Validate the packet size Merged-by: James Almer <jamrial@gmail.com>
| * flv: Validate the packet sizeLuca Barbato2017-04-20
| | | | | | | | | | | | | | Size can be negative at that point. Bug-Id: 1041 CC: libav-stable@libav.org
| * flvdec: Set avg_frame_rate for video streamsCarl Eugen Hoyos2017-03-22
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | flvdec: Check the avio_seek return value after reading a metadata packetMartin Storsjö2017-10-27
| | | | | | | | | | | | | | | | | | | | | | | | merge from libav: 585dc1aecef0371ad6f16cb3750ae2a6da9cf00a 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.
* | Revert "flvdec: Check the avio_seek return value after reading a metadata ↵Steven Liu2017-10-27
| | | | | | | | | | | | packet" This reverts commit ef7fe81b8554a2865d47a55edf47420878fa3d91.
* | flvdec: Check the avio_seek return value after reading a metadata packetSteven Liu2017-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | merge from libav: 585dc1aecef0371ad6f16cb3750ae2a6da9cf00a 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>
* | avformat/flvdec: Set need_context_update when setting the initial extradataAlex Converse2017-09-03
| | | | | | | | | | | | Fixes ticket 6398. Debugged with the help of James Almer and Hendrik Leppkes.
* | avformat/flvdec: check FLVHeader PreviousTagSize0Steven Liu2017-03-28
| | | | | | | | | | | | | | | | | | | | | | | | refer to SPEC: Annex E. The FLV File Format said: E.3 TheFLVFileBody have a table: Field Type Comment PreviousTagSize0 UI32 Always 0 Reviewed-by: Bela Bodecs <bodecsb@vivanet.hu> Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* | Merge commit '83548fe894cdb455cc127f754d09905b6d23c173'James Almer2017-03-21
|\| | | | | | | | | | | | | * commit '83548fe894cdb455cc127f754d09905b6d23c173': lavf: fix usage of AVIOContext.seekable Merged-by: James Almer <jamrial@gmail.com>
| * lavf: fix usage of AVIOContext.seekableAnton Khirnov2016-09-30
| | | | | | | | | | | | | | | | It is supposed to be a flag. The only currently defined value is AVIO_SEEKABLE_NORMAL, but other ones may be added in the future. However all the current lavf code treats this field as a bool (mainly for historical reasons). Change all those cases to properly check for AVIO_SEEKABLE_NORMAL.
* | avformat/flvdec: remove meaningless warningwm42017-03-06
| | | | | | | | | | | | Ever since the codecpar changes, this has been always printed when opening a flv file. This is because the codecpar changes made all streams to be added lazily as read_packet is called.
* | refine avformat/flvdec set bit_rateSteven Liu2016-11-26
| |
* | avformat/flvdec: move set bit_rate from parse AMF OBJECT toSteven Liu2016-11-26
| | | | | | | | | | | | | | | | | | | | | | | | | | create_stream before patch: Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x714 [SAR 1:1 DAR 640:357], 25 fps, 25 tbr, 1k tbn, 50 tbc after patch: Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x714 [SAR 1:1 DAR 640:357], 2576 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc Signed-off-by: Steven Liu <lq@chinaffmpeg.org> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/flvdec: Set avg_frame_rate for video streams.Carl Eugen Hoyos2016-11-25
| | | | | | | | | | Requested-by: qw, applemax82 at 163 dot com Reviewed-by: Steven Liu
* | flvdec: require need_context_update when changing codec idAndreas Cadhalpun2016-11-25
| | | | | | | | | | | | | | | | Otherwise the codec context and codecpar might disagree on the codec id, triggering asserts in av_parser_parse2. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avformat/flvdec: add debug message to list keyframes index metadataSteven Liu2016-11-19
| | | | | | | | | | | | | | when parsing keyframe index metadata, list the message by trace log Signed-off-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: Fix regression loosing streamsMichael Niedermayer2016-10-28
| | | | | | | | | | | | | | Fixes: unknown_video.flv Found-by: Thierry Foucu <tfoucu@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/flvdec: init AVPacket::pos to FLVTAG offsetSuman-2016-10-26
| | | | | | | | | | | | Current code doesn't initialize AVPacket::pos. Made it point to FLVTAG so flv_read_packet can decode from pos Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: parse keyframe before a\v stream was created ↵Xinzheng Zhang2016-07-27
| | | | | | | | | | | | add_keyframes_index() when stream created or keyframe parsed Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: splitting add_keyframes_index() out from ↵Xinzheng Zhang2016-07-27
| | | | | | | | | | | | parse_keyframes_index() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: Do not check last size if it could not be read due to EOFMichael Niedermayer2016-06-22
| | | | | | | | | | Fixes part of Ticket5648 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: Also print sum_flv_tag_size on size mismatchesMichael Niedermayer2016-06-22
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: Accept last size if its off by 1Michael Niedermayer2016-06-22
| | | | | | | | | | | | Fixes part of Ticket5648 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb'Clément Bœsch2016-06-21
|\| | | | | | | | | | | | | * commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb': cosmetics: Fix spelling mistakes Merged-by: Clément Bœsch <u@pkh.me>
| * cosmetics: Fix spelling mistakesVittorio Giovara2016-05-04
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avformat: add AVFormatContext to ff_get_extradata()Paul B Mahol2016-04-14
| | | | | | | | | | | | Needed for av_log() inside that function. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* | lavf/flvdec: Allow files where the PreviousTagSize is not set according to ↵Thierry Foucu2016-01-29
| | | | | | | | | | | | | | | | | | | | the spec. Some muxer use the FLV field PreviousTagSize to be the sum of tag length. Without this change, the flv demuxer think the file is broken and the re-sync will fail. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'e4eb13ca77624401ea7cef1ed6ad8e2d13fd2063'Derek Buitenhuis2016-01-27
|\| | | | | | | Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * flvdec: Add sanity checking of the last packet sizeMartin Storsjö2016-01-19
| | | | | | | | | | | | | | | | For http, this avoids spurious warnings about failed requests (e.g. HTTP error 416 Requested Range Not Satisfiable), if the last packet is truncated and the size read is bogus. Signed-off-by: Martin Storsjö <martin@martin.st>
* | Merge commit '09f4822e4eaf61513b9092414450f3ae920ccd9d'Derek Buitenhuis2016-01-27
|\| | | | | | | Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>