summaryrefslogtreecommitdiff
path: root/libavformat/flvdec.c
Commit message (Collapse)AuthorAge
* 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>
| * flvdec: perform duration search just onceMichael Niedermayer2016-01-19
| | | | | | | | | | | | | | | | When loading a truncated flv file, it would previously try to do a seek to the end of every packet read. For some input protocols (such as http), such repeated seek attempts are cripple the reading performance. Signed-off-by: Martin Storsjö <martin@martin.st>
| * flvdec: do not create any streams in read_header()Anton Khirnov2015-12-12
| | | | | | | | | | | | | | | | | | | | | | The current muxer behaviour is to create streams in read_header() based on the audio/video presence flags, but fill in the stream parameters later when we actually get some packets for them. This is rather shady, since other demuxers set the stream parameters immediately when the stream is created and do not touch the stream codec context after that. Change the flv demuxer to behave in the same way as other similar demuxers -- create the streams only when we get a packet for them.
* | avformat/flvdec: Fix left shift of 137 by 24 places cannot be represented in ↵Michael Niedermayer2015-12-04
| | | | | | | | | | | | | | | | | | type int Fixes: 3c857d4d90365731524716e6d051e43a/signal_sigsegv_7f4f59bcc29e_1386_20abd2c8e655cb9c75b24368e65fe3b1.flv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | lavf/flvdec: use FFERROR_REDO instead of AVERROR(EAGAIN).Nicolas George2015-12-03
| | | | | | | | Fix trac ticket #5041.
* | Replace remaining occurances of av_free_packet with av_packet_unrefHendrik Leppkes2015-10-27
| |
* | avformat/flvdec: set broken_sizes for "metadatacreator : MEGA"Michael Niedermayer2015-10-12
| | | | | | | | | | | | | | | | The 2nd size value is wrong for the sample file Fixes: Ticket4903 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: Print stream type in case a new stream is discovered after ↵Michael Niedermayer2015-10-07
| | | | | | | | | | | | the header Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: Remove dead loopMichael Niedermayer2015-10-06
| | | | | | | | | | | | Fixes CID1325682 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: accept sizes if they are off by 11Michael Niedermayer2015-10-02
| | | | | | | | | | | | | | | | | | This error was produced by rtmproto.c, it is possibly such streams where dumped, this commit is needed to support them Fixes: z0e.flv Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libavformat/flvdec.c: free always the packet after a resync.Thierry Foucu2015-09-29
| | | | | | | | | | | | | | | | In case of resync, always free the packet, but retry only if the resync did not get to the end of the file. Otherwise, there is a memory leak when the last packet in the file is corrupted. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: Detect broken sizes (OBS 0.655b), disable resync for ↵Michael Niedermayer2015-09-19
| | | | | | | | | | | | | | affected files Fixes Ticket4867 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: Check that sizes match and resync if notMichael Niedermayer2015-09-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: Change packet loop to return EAGAIN instead of looping ↵Michael Niedermayer2015-09-16
| | | | | | | | | | | | until a valid packet is foud Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: Use the first index entry to find the first packet if there ↵Michael Niedermayer2015-09-13
| | | | | | | | | | | | | | | | was a parsing error in the header Fixes: unknow_codec.flv Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: Print last packet size at trace levelMichael Niedermayer2015-09-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/flvdec: Print terminator value found if it differs from ↵Michael Niedermayer2015-09-13
| | | | | | | | | | | | AMF_END_OF_OBJECT in AMF_DATA_TYPE_MIXEDARRAY Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'a7ac1a7b94447f33ae95be4d6d186e2775977f91'Michael Niedermayer2015-06-12
|\| | | | | | | | | | | | | | | | | | | * commit 'a7ac1a7b94447f33ae95be4d6d186e2775977f91': flv: Name an enum and use its type Conflicts: libavformat/flvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * flv: Name an enum and use its typeVittorio Giovara2015-06-12
| |
* | libavformat/flvdec.c: don't build index_entries for input stream if ↵Igor Derzhavin2015-06-10
| | | | | | | | | | | | | | AVIOContext is not seekable Signed-off-by: Igor Derzhavin <igor.derzhavin@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | flvdec: fix lack of duration for some filesGanesh Ajjanagadde2015-06-05
| | | | | | | | | | | | | | Fixes #4579 Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/flvdec: Show unknown tags at debug levelMichael Niedermayer2015-06-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/flvdec: Add TYPE_ONCAPTIONINFOMichael Niedermayer2015-06-05
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>