summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
Commit message (Collapse)AuthorAge
* avformat: Ignore ID3v2 tags if other tags are present e.g. vorbisPaul Arzelier2017-01-28
| | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/utils.c Protect against accessing entries[nb_entries]Matt Wolenetz2016-12-30
| | | | | | | | | | | In ff_index_search_timestamp(), if b == num_entries, m == num_entries - 1, and entries[m].flags & AVINDEX_DISCARD_FRAME is true, then the search for the next non-discarded packet could access entries[nb_entries], exceeding its bounds. This change adds a protection against that scenario. Reference: https://crbug.com/666770 Reviewed-by: Sasi Inguva <isasi@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: Auto-detect mjpeg 2000 in mpeg-tsStåle Kristoffersen2016-12-17
| | | | | | | This makes it possible to decode motion jpeg 2000 encoded in a transport stream without a correct PMT/PAT. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: Print verbose error message if stream count exceeds max_streamsMichael Niedermayer2016-12-13
| | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: Add max_streams optionMichael Niedermayer2016-12-08
| | | | | | This allows user apps to stop OOM due to excessive number of streams Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: fix the wrong warning msg and comments about av_find_stream_infoJun Zhao2016-12-05
| | | | | | | | | av_find_stream_info() was deprecated by avformat_find_stream_info(), correct the warning message in the avformat_find_stream_info() and comments in the avformat.h Signed-off-by: Jun Zhao <jun.zhao@intel.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: Check start/end before computing duration in ↵Michael Niedermayer2016-12-03
| | | | | | | | | | update_stream_timings() Fixes undefined behavior Fixes: 637428.ogg Found-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: Fix type mismatchMichael Niedermayer2016-11-27
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: always forward codec_whitelist in avformat_find_stream_infoAndreas Cadhalpun2016-11-26
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avformat/utils: add missing brackets around arguments in av_realloc() callJames Almer2016-11-21
| | | | | Found-by: Neil Birkbeck <neil.birkbeck@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: check for overflow before reallocating side dataJames Almer2016-11-19
| | | | | | | This makes av_stream_add_side_data() consistent with av_packet_add_side_data(). Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: add av_stream_add_side_data()James Almer2016-11-18
| | | | | | | | Functionally similar to av_packet_add_side_data(). Allows the use of an already allocated buffer as stream side data. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: close parser if codec changedAndreas Cadhalpun2016-11-02
| | | | | | | | | The parser depends on the codec and thus must not be used with a different one. If it is, the 'avctx->codec_id == s->parser->codec_ids[0] ...' assert in av_parser_parse2 gets triggered. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* Revert "img2 encoder: allow %t in filename, based on patch from Yuval Adam"Michael Niedermayer2016-11-01
| | | | | | | breaks API Found-by: jamrial This reverts commit 1a956c64c8eff5edecb004fc7aafd21207e6485c.
* img2 encoder: allow %t in filename, based on patch from Yuval Adamrogerdpack2016-11-01
| | | | | Signed-off-by: rogerdpack <rogerpack2005@gmail.com> 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>
* Revert "avformat/utils: Discard huge timestamps which would cause overflows ↵Michael Niedermayer2016-10-26
| | | | | | | | | if used in basic computations" Some people seem to oppose this the patch seems to have been missed for a month on the ML lets restart the discussion and solve this after the release This reverts commit e936c8d176efd1a0a41e22df24564b1178c79ea9.
* avformat/utils: Discard huge timestamps which would cause overflows if used ↵Michael Niedermayer2016-10-26
| | | | | | | | | | | | | in basic computations Allowing larger timestamps makes it impossible to calculate basic things like the difference of 2 timestamps or their sum without checking each individual computation for overflow. This should avoid a significant number of overflow checks Fixes Ticket5136 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: prevent triggering request_probe assert in ff_read_packetAndreas Cadhalpun2016-10-19
| | | | | | | | | | | | | If probe_codec is called with pkt == NULL, it sets probe_packets to 0 and request_probe to -1. However, request_probe can change when calling s->iformat->read_packet and thus a probe_packets value of 0 doesn't guarantee a request_probe value of -1. In that case calling probe_codec again is necessary to prevent triggering the assert. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avformat/utils: Update codec_id before using it in the parser initMichael Niedermayer2016-10-10
| | | | | | | | | Fixes assertion failure Fixes: input.avi Found-by: 连一汉 <lianyihan@360.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/utils: avoid using programs for duration when there's only oneRodger Combs2016-10-06
| | | | | This allows us to be more selective about the streams we derive durations from (specifically, ignoring text streams with outlier end times) in the common case
* lavf/utils: ignore outlier subtitle and data stream end times as wellRodger Combs2016-10-06
|
* avformat: add av_stream_get_codec_timebase()James Almer2016-09-27
| | | | | | This will allow ffmpeg.c to stop using AVStream.codec in some cases Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/utils: Avoid an overflow for huge negative durations.Carl Eugen Hoyos2016-09-24
| | | | Fixes ticket #5135.
* avformat/utils: avoid using marked decoders for probingTimo Rothenpieler2016-09-23
| | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: force native h264 decoder for probingTimo Rothenpieler2016-09-22
| | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
* ffmpeg: switch to codecparClément Bœsch2016-09-21
| | | | | | | | | | | | | | | | | | | | This commit is largely based on commit 15e84ed3 from Anton Khirnov <anton@khirnov.net> which was previously skipped in bbf5ef9d. There are still a bunch of things raising codecpar related warnings that need fixing, such as: - the use of codec->debug in the interactive debug mode - read_ffserver_streams(): it's probably broken now but there is no test - lowres stuff - codec copy apparently required by bitstream filters The matroska references are updated because they now properly forward the field_order (previously unknown, now progressive). Thanks to James Almer for fixing a bunch of FATE issues in this commit. Signed-off-by: Clément Bœsch <clement@stupeflix.com> Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/utils: Support av_index_search_timestamp in case of AVIndexEntry with ↵Sasi Inguva2016-09-19
| | | | | | | discarded packets. Signed-off-by: Sasi Inguva <isasi@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: fix timebase error in avformat_seek_file()Xinzheng Zhang2016-09-14
| | | | | | | | When there is only one stream and stream_index has not specified, The ts has been transferd by the timebase of stream0 without modifying the stream_index In this condation it cause seek failure. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/utils: add missing ismv in MOV-like formatsClément Bœsch2016-09-14
|
* lavf/utils: simplify matching MOV-like formatsClément Bœsch2016-09-14
|
* lavf: add avformat_transfer_internal_stream_timing_info() and use it in ffmpegClément Bœsch2016-09-14
| | | | | In lavf we have access to st->internal->avctx so it's a better place than in ffmpeg*.c and will allow moving to codecpar.
* avformat: Export ticks_per_frame in st->codecMichael Niedermayer2016-09-07
| | | | | | | | | | Fixes regressions with stream copy and output timebase/fps being twice as fine as needed Makes the timebase and ticks per frame handled identical which should make the code easier to understand and work with. It does not solve the problem without st->codec access Suggested-by: Hendrik Leppkes Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: fix a codecpar non useJames Almer2016-08-27
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: End probing if the expected codec surpasses ↵Michael Niedermayer2016-08-27
| | | | | | | | AVPROBE_SCORE_STREAM_RETRY Fixes Ticket5800 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavformat/utils: added ability to probe AVMEDIA_TYPE_DATA formatErkki Seppälä2016-08-23
| | | | | | | | | | Now force_codec_ids supports AVMEDIA_TYPE_DATA and avformat_query_codec accepts data codecs as well in addition to video, audio and subtitle tracks. Signed-off-by: Erkki Seppälä <erkki.seppala.ext@nokia.com> Signed-off-by: OZOPlayer <OZOPL@nokia.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: add 64-bit signed pcm codecPaul B Mahol2016-08-18
|
* avformat: factorize iso 8601 timestamp writer to a dictionary avutil functionMarton Balint2016-08-17
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf: mark stream as const pointer in av_stream_get_side_data() for next bumpClément Bœsch2016-08-17
|
* lavf/utils: add some const to pointers parameters in a few functionsClément Bœsch2016-08-17
|
* avformat: Add av_get_frame_filename2() and AV_FRAME_FILENAME_FLAGS_MULTIPLEMichael Niedermayer2016-08-04
| | | | | | | This will be used to allow writing file sequences using the tee output onto multiple places in parallel Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: Fix find_stream_info not considering the extradata it foundAnssi Hannula2016-07-28
| | | | | | | | | | | | | | | | | | | Commit 9200514ad8717c6 ("lavf: replace AVStream.codec with AVStream.codecpar") merged in commit 6f69f7a8bf6a0d01 changed avformat_find_stream_info() to put the extradata it got from st->parser->parser->split() to st->internal->avctx instead of st->codec (extradata in st->internal->avctx will be later copied to st->codecpar). However, in the same function, the "is stream ready?" check was changed to check for extradata in st->codecpar instead of st->codec, even though st->codecpar is not yet updated at that point. Extradata retrieved from split() is therefore not considered anymore, and avformat_find_stream_info() will therefore needlessly continue probing in some cases. Fix that by checking for the extradata at st->internal->avctx where it is actually put.
* avformat/utils: Add ff_format_output_open() functionJan Sebechlebsky2016-07-16
| | | | | | | | Add ff_format_output_open utility function to wrap io_open callback of AVFormatContext structure. Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/utils: Add ff_stream_encode_params_copy()Jan Sebechlebsky2016-07-16
| | | | | Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/utils: update deprecated AVStream->codec when the context is updatedHendrik Leppkes2016-06-30
| | | | | | | | | This ensures the AVStream->codec entry is kept in sync when new streams are discovered mid-playback or changes to the context occur from other sources. Fixes trac 5678. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: update auto-bsf to new BSF APIRodger Combs2016-06-25
|
* lavf: deprecate av_apply_bitstream_filtersRodger Combs2016-06-25
|
* lavf/utils: fix const warning at a find_decoder() callClément Bœsch2016-06-25
|
* avformat/utils: Use internal->avctx for bitrate in ↵Michael Niedermayer2016-06-22
| | | | | | | | | | estimate_timings_from_bit_rate() if needed The internal avctx bitrate is copied into codecpar after estimate_timings() Fixes Ticket5646 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/utils: change bit_rate to 64 bit in estimate_timings_from_bit_rate()Michael Niedermayer2016-06-22
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>