aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/cache.c
Commit message (Collapse)AuthorAgeFilesLines
* avformat/async,cache: Use more unique context namesAndreas Rheinhardt2024-05-251-9/+9
| | | | | | | | Otherwise Doxygen thinks any text like "Context for foo" is a link to the async protocol's struct called "Context". Reported-by: Andrew Sayers <ffmpeg-devel@pileofstuff.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* 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>
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-201-0/+1
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-221-1/+0
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/internal: Move avpriv-file API to a header of its ownAndreas Rheinhardt2022-09-031-2/+2
| | | | | | | It is not used by the large majority of files that include lavu/internal.h. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Replace ffurl_close() by ffurl_closep() where appropriateAndreas Rheinhardt2020-05-251-1/+1
| | | | | | | | | | It avoids leaving dangling pointers behind in memory. Also remove redundant checks for whether the URLContext to be closed is already NULL. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/cache: rename the class name fro Cache to cacheSteven Liu2019-12-111-1/+1
| | | | | | | | | | | | liuqideMacBook-Pro:build liuqi$ ffmpeg --help full | grep cache cannot find cache protocol options. after patch: bogon:dash liuqi$ ./ffmpeg --help full | grep cache cache AVOptions: can find the cache AVOptions after patch. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/cache - delete cache file after closing handleGyan Doshi2019-05-251-2/+15
| | | | Verified that cache files get deleted on Windows.
* libavformat: not treat 0 as EOFDaniel Kucera2017-10-191-2/+2
| | | | | | | | | | transfer_func variable passed to retry_transfer_wrapper are h->prot->url_read and h->prot->url_write functions. These need to return EOF or other error properly. In case of returning >= 0, url_read/url_write is retried until error is returned. Signed-off-by: Daniel Kucera <daniel.kucera@gmail.com>
* Merge commit 'fab8156b2f30666adabe227b3d7712fd193873b1'Derek Buitenhuis2016-04-211-1/+1
| | | | | | | * commit 'fab8156b2f30666adabe227b3d7712fd193873b1': avio: Copy URLContext generic options into child URLContexts Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Use avpriv_tempfile()Michael Niedermayer2016-03-121-2/+2
| | | | | | | | | Should fix xvid/cache on windows with --enable-shared May be related to Ticket 4780 Tested-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: Add a protocol blacklisting APIDerek Buitenhuis2016-03-041-1/+1
| | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/cache: Fix memleak of tree entriesMichael Niedermayer2016-03-021-0/+7
| | | | | | Found-by: jamrial Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '2758cdedfb7ac61f8b5e4861f99218b6fd43491d'Derek Buitenhuis2016-02-291-1/+1
| | | | | | | | | | | This commit also disables the async fate test, because it used internal APIs in a non-kosher way, which no longer exists. * commit '2758cdedfb7ac61f8b5e4861f99218b6fd43491d': lavf: reorganize URLProtocols Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* Update demuxers and protocols for protocol whitelist supportMichael Niedermayer2016-02-021-1/+2
| | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/cache: Avoid int-overflow in cache compare functionBryan Huh2015-11-091-1/+1
| | | | | | | | | | | cache protocol indexes its cache using AVTreeNodes which require a cmp function for inserting and searching new cache-entries. This cmp function expects a 32-bit int return value (negative, zero, or positive) but the cache cmp function returns an int64_t which can overflow the int, giving negative numbers for when it should be positive, vice versa. This manifests itself only for very large files (e.g. 4GB+) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/cache: Use int64_t to avoid int overflow in cache_readBryan Huh2015-11-041-1/+1
| | | | | | | | | | | | Fixes an issue where an int64_t ffurl_seek return-value was being stored in an int (32-bit) "r" variable, leading to integer overflow when seeking into a large file (>2GB), and ultimately a "Failed to perform internal seek" error mesage. To test, try running `ffprobe 'cache:http://<something>'` on a file that is ~3GB large, whose moov atom is at the end of the file Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/tree: add additional const qualifier to the comparatorGanesh Ajjanagadde2015-10-241-2/+2
| | | | | | | | | | | | | libc's qsort comparator has a const qualifier on both arguments. This adds a missing const qualifier to exactly match the comparator API. Existing usages of av_tree_find, av_tree_insert are appropriately modified: type signature changes of the comparators, and removal of unnecessary void * casts of function pointers. Reviewed-by: Henrik Gramner <henrik@gramner.com> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* fix spelling errorsAndreas Cadhalpun2015-03-061-2/+2
| | | | | | | | | | | opttimizations -> optimizations grabing -> grabbing many resource -> many resources isnt -> isn't silcense -> silence Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/cache: pass options to the underlying protocol via the url_open2Zhang Rui2015-01-311-3/+3
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/cache: remove ftruncate usage, its not always availableMichael Niedermayer2014-12-261-2/+2
| | | | | | | | | | In case of errors the cache file will be slightly larger than needed, this should have no practical relevance though Should fix build on VS201* Found-by: jamrial Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/cache: Extend cache entries if possible instead of creating new onesMichael Niedermayer2014-12-261-17/+29
| | | | | | | This reduces the number of cache entries and should significantly reduce memory requirements Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/cache: avoid lseek() on reading from the cache if possibleMichael Niedermayer2014-12-261-2/+6
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/cache: keep cache_pos updatedMichael Niedermayer2014-12-261-2/+6
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/cache: cleanup cache file on cache write failureMichael Niedermayer2014-12-261-1/+3
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/cache: Support user specified read-ahead for non seekable mediaMichael Niedermayer2014-12-251-1/+41
| | | | | | Fixes Ticket2406 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/cache: Use the correct io handle in seekingMichael Niedermayer2014-12-251-5/+7
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/cache: more informative error messageMichael Niedermayer2014-12-251-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/cache: remember EOF point if hit and use it to handle SEEK_ENDMichael Niedermayer2014-12-251-0/+10
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avformat/cache: support non continuous cachingMichael Niedermayer2014-12-251-29/+137
| | | | | | | This allows using the cache protocol on top of seekable but slow protocols to speed them up Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* cache: check lseek() returnMichael Niedermayer2012-10-181-1/+3
| | | | | Fixes CID717496 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* cache: Only include unistd.h if it existsDerek Buitenhuis2012-09-071-1/+3
| | | | | | | This follows suite from f3be3597079be7cd7adbb8392c32e408cadd3da2. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* cache: fix "warning: passing argument 2 of ‘av_tempfile’ from ↵Michael Niedermayer2012-02-061-1/+1
| | | | | | incompatible pointer type" Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* cache: use av_freep instead of av_free in cache_openJean First2011-12-311-1/+1
| | | | | Signed-off-by: Jean First <jeanfirst@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* cache: remove unused variable in cache_openJean First2011-12-311-1/+0
| | | | | Signed-off-by: Jean First <jeanfirst@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-021-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (25 commits) rtpenc: Add support for G726 audio rtpdec: Interpret the different G726 names as bits_per_coded_sample rtpenc: Change rtp_send_samples to handle sample sizes other than even bytes rtpenc: Cast a rescaling parameter to int64_t h264: cap max has_b_frames at MAX_DELAYED_PIC_COUNT - 1. ARM: fix indentation in ff_dsputil_init_neon() ARM: NEON put/avg_pixels8/16 cosmetics ARM: add remaining NEON avg_pixels8/16 functions ARM: clean up NEON put/avg_pixels macros fate: split acodec-pcm into individual tests swscale: #include "libavutil/mathematics.h" pmpdec: don't use deprecated av_set_pts_info. rv34: align temporary block of "dct" coefs Add PlayStation Portable PMP format demuxer proto: Realign struct initializers proto: Use .priv_data_size to allocate the private context mmsh: Properly clean up if the second ffurl_alloc failed rtmp: Clean up properly if the handshake failed md5proto: Remove the get_file_handle function applehttpproto: Use the close function if the open function fails ... Conflicts: libavcodec/vble.c libavformat/mmsh.c libavformat/pmpdec.c libavformat/udp.c tests/ref/acodec/pcm Merged-by: Michael Niedermayer <michaelni@gmx.at>
* Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: lavf: pass options from AVFormatContext to avio. avformat: Use avio_open2, pass the AVFormatContext interrupt_callback onwards avio: add avio_open2, taking an interrupt callback and options avio: add support for passing options to protocols. avio: add and use ffurl_protocol_next(). avformat: Pass the interrupt callback on to chained muxers/demuxers avio: Add an AVIOInterruptCB parameter to ffurl_open/ffurl_alloc avformat: Use ff_check_interrupt avio: Add an internal utility function for checking the new interrupt callback avio: Add AVIOInterruptCB texi2html: remove stray \n doc: prettyfy the texi2html documentation swscale: handle unaligned buffers in yuv2plane1 Conflicts: libavformat/avformat.h libavformat/avio.c libavformat/mov.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
* av_tempfile: Pass int log_offset, void *log_ctxMichael Niedermayer2011-10-161-1/+1
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* cache: add todo listMichael Niedermayer2011-10-161-0/+7
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* cache: Fallback to using the cache size for AVSEEK_SIZE if the underlaying ↵Michael Niedermayer2011-10-161-1/+8
| | | | | | protocol has nothing better. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* add cache protocolMichael Niedermayer2011-10-161-0/+130
This allows backward seeking on top of some non seekable streams. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>