aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/seek.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat: remove deprecated FF_API_AVSTREAM_SIDE_DATAJames Almer2025-03-281-7/+0
| | | | | | Deprecated since 2023-10-06. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/seek: Remove always true conditionZhao Zhili2025-02-041-12/+10
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/seek: Remove dead codeZhao Zhili2025-02-041-4/+0
| | | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com> Reviewed-by: Marth64 <marth64@proxyid.net>
* lavf: add a header for generic-layer interfacesAnton Khirnov2024-10-161-0/+1
| | | | Analogous to what was previously done in avcodec and avfilter.
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-0/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Add FFInputFormat, hide internals of AVInputFormatAndreas Rheinhardt2024-03-071-11/+11
| | | | | | | | | | | | | | | | | | | | | This commit does for AVInputFormat what commit 59c9dc82f450638a3068deeb1db5c56f6d155752 did for AVOutputFormat: It adds a new type FFInputFormat, moves all the internals of AVInputFormat to it and adds a now reduced AVInputFormat as first member. This does not affect/improve extensibility of both public or private fields for demuxers (it is still a mess due to lavd). This is possible since 50f34172e0cca2cabc5836308ec66dbf93f5f2a3 (which removed the last usage of an internal field of AVInputFormat in fftools). (Hint: tools/probetest.c accesses the internals of FFInputFormat as well, but given that it is a testing tool this is not considered a problem.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: use the side data from AVStream.codecparJames Almer2023-10-061-0/+2
| | | | | | | | | | | | Deprecate AVStream.side_data and its helpers in favor of the AVStream's codecpar.coded_side_data. This will considerably simplify the propagation of global side data to decoders and from encoders. Instead of having to do it inside packets, it will be available during init(). Global and frame specific side data will therefore be distinct. Signed-off-by: James Almer <jamrial@gmail.com>
* libavformat: Improve ff_configure_buffers_for_index for excessive deltasMartin Storsjö2023-04-021-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the ff_configure_buffers_for_index function had upper sanity limits of 16 MB (1<<24) for buffer_size and 8 MB (1<<23) for short_seek_threshold. However, if the index contained entries with a much larger delta, setting pos_delta to a value larger than the sanity limit, we would end up not increasing the buffer size at all. Instead, ignore the individual deltas that are excessive, but increase the buffer size based on the deltas that are below the sanity limit. Only count deltas that are below 1<<23, 8 MB; pos_delta gets doubled before setting the buffer size - this matches the previous maximum buffer size of 1<<24, 16 MB. This can happen e.g. with a mov file with some tracks containing some samples that belong in the start of the file, at the end of the mdat, while the rest of the file is mostly reasonably interleaved; previously those samples caused the maximum pos_delta to skyrocket, skipping any buffer size enlargement. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Account for negative position differences in ↵Martin Storsjö2023-04-021-1/+3
| | | | | | | | | | | ff_configure_buffers_for_index When scanning through the index, account for the fact that the compared samples may be located in an unexpected order in the file; this function is mainly interested in the absolute difference between file locations. Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/internal: Don't include avcodec.hAndreas Rheinhardt2022-09-261-0/+2
| | | | | | | | | | | | | | | The general demuxing API uses parsers and decoders. Therefore FFStream contains pointers to AVCodecContexts and AVCodecParserContext and lavf/internal.h includes lavc/avcodec.h. Yet actually only a few files files really use these; and it is best when this number stays small. Therefore this commit uses opaque structs in lavf/internal.h for these contexts and stops including avcodec.h. This also avoids including lavc/codec_desc.h implicitly. All other headers are implicitly included as now (mostly through codec.h). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/demux: Add new demux.h headerAndreas Rheinhardt2022-05-101-0/+1
| | | | | | And move those stuff already in demuxer-only files to it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/seek: add ff_rescale_interval() functionPierre-Anthony Lemieux2022-03-191-0/+10
| | | | | | Refactors a function used by avformat/concat and avformat/imf. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* seek: Fix crashes in ff_seek_frame_binary if built with latest Clang 14Martin Storsjö2021-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Passing an uninitialized variable as argument to a function is undefined behaviour (UB). The compiler can assume that UB does not happen. Hence, the compiler can assume that the variables are never uninitialized when passed as argument, which means that the codepaths that initializes them must be taken. In ff_seek_frame_binary, this means that the compiler can assume that the codepaths that initialize pos_min and pos_max are taken, which means that the conditions "if (sti->index_entries)" and "if (index >= 0)" can be optimized out. Current Clang git versions (upcoming Clang 14) enabled an optimization that does this, which broke the current version of this function (which intentionally left the variables uninitialized, but silencing warnings about being uninitialized). See [1] for discussion on the matter. [1] https://reviews.llvm.org/D105169#3069555 Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/utils: Move seeking code out into a new fileAndreas Rheinhardt2021-09-171-0/+753
| | | | | | | | | | | | libavformat/utils.c has over 5500 lines and is supposed to contain "various utility functions for use within FFmpeg". In reality it contains all that and the whole demuxing+seeking core of libavformat. This is especially bad, because said file includes the FFMPEG_VERSION (the git commit sha) so that it is rebuilt whenever the commit HEAD points to changes. Therefore this commit starts making it smaller by factoring the seeking code out. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf: remove unused codewm42015-02-081-508/+0
| | | | | | | | | | | | | Nothing uses it, and it provides no public API. Archeological finds: Commit 101036adb9 added the API. Commit a8dd8dc6e9 made mpegts.c use it. Commit af8aae3fa3 disabled it by default in mpegts.c. Commit ae2bb52cd2 removed all uses of this from mpegts.c. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* Add missing #includes for *INT64_MAX and *INT64_CDiego Biurrun2013-11-231-0/+2
|
* lavf: remove unreliable timestamp guessing heuristicAnton Khirnov2013-10-281-3/+0
|
* lavf: deobfuscate read_frame_internal().Anton Khirnov2012-03-051-13/+4
| | | | | | | | | | | | | | Split off packet parsing into a separate function. Parse full packets at once and store them in a queue, eliminating the need for tracking parsing state in AVStream. The horrible unreadable loop in read_frame_internal() now isn't weirdly ordered and doesn't contain evil gotos, so it should be much easier to understand. compute_pkt_fields() now invents slightly different timestamps for two raw vc1 tests, due to has_b_frames being set a bit later. They shouldn't be more wrong (or right) than previous ones.
* cosmetics: Remove extra newlines at EOFAlex Converse2012-01-271-1/+0
|
* Do not include mathematics.h in avutil.hMans Rullgard2011-07-031-0/+1
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* avio: add avio_tell macro as a replacement for url_ftellAnton Khirnov2011-03-041-1/+1
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avio: avio_ prefix for url_fseekAnton Khirnov2011-03-011-3/+3
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Replace all occurences of PKT_FLAG_KEY with AV_PKT_FLAG_KEY.Jean-Daniel Dupas2010-03-311-1/+1
| | | | | | Patch by Jean-Daniel Dupas, devlists shadowlab org Originally committed as revision 22744 to svn://svn.ffmpeg.org/ffmpeg/trunk
* rename av_read_frame_flush to ff_read_frame_flushAurelien Jacobs2010-03-151-2/+2
| | | | | | it is an internal function, not part of public API Originally committed as revision 22562 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add internal.h include for av_read_frame_flush prototypeDavid Conrad2010-03-071-0/+1
| | | | | | Fixes build with clang Originally committed as revision 22273 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move av_read_frame_flush() prototype to lavf/internal.hMåns Rullgård2010-03-061-1/+0
| | | | Originally committed as revision 22268 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use av_compare_ts from libavutil instead of the locale compare_ts, theReimar Döffinger2010-02-101-39/+7
| | | | | | calculations in the later one are not correct with large time stamps. Originally committed as revision 21744 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use I/O buffer size as initial value for backoff for seeking sync point search.Ivan Schreter2009-09-131-2/+2
| | | | Originally committed as revision 19829 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetic changes (indentation, doxygen comments, braces, put structures for ↵Ivan Schreter2009-09-051-109/+81
| | | | | | API to header, ...) Originally committed as revision 19773 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Support for generic multi-stream key frame finding for new seek API.Ivan Schreter2009-08-221-0/+578
Originally committed as revision 19680 to svn://svn.ffmpeg.org/ffmpeg/trunk