summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
Commit message (Collapse)AuthorAge
* Remove commented-out debug #define cruftDiego Biurrun2013-05-16
|
* avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriateDiego Biurrun2013-05-04
|
* silly typo fixesDiego Biurrun2013-05-03
|
* lavf: make sure stream probe data gets freed.Anton Khirnov2013-04-04
| | | | | Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* lavf: sanity check size in av_get/append_packet().Anton Khirnov2013-03-15
| | | | | | To avoid allocating ridiculous amounts of memory for corrupted files, read the input in chunks limited to filesize or an arbitrary large amount when that is not known (chosen to be 50M).
* lavf: remove disabled FF_API_R_FRAME_RATE cruftAnton Khirnov2013-03-11
|
* lavf: remove disabled FF_API_AV_GETTIME cruftAnton Khirnov2013-03-11
|
* lavf: remove disabled FF_API_READ_PACKET cruftAnton Khirnov2013-03-11
|
* lavf: remove disabled FF_API_CLOSE_INPUT_FILE cruftAnton Khirnov2013-03-11
|
* avpacket: use AVBuffer to allow refcounting the packets.Anton Khirnov2013-03-08
| | | | | | This will allow us to avoid copying the packets in many cases. This breaks ABI.
* Use the avstring.h locale-independent character type functionsReimar Döffinger2013-03-07
| | | | | | Make sure the behavior does not change with the locale. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Handle the environment variable no_proxy more properlyMartin Storsjö2013-02-27
| | | | | | | | | | | | | | | | | | | | The handling of the environment variable no_proxy, present since one of the initial commits (de6d9b6404), is inconsistent with how many other applications and libraries interpret this variable. Its bare presence does not indicate that the use of proxies should be skipped, but it is some sort of pattern for hosts that does not need using a proxy (e.g. for a local network). As investigated by Rudolf Polzer, different libraries handle this in different ways, some supporting IP address masks, some supporting arbitrary globbing using *, some just checking that the pattern matches the end of the hostname without regard for whether it actually is the right domain or a domain that ends in the same string. This simple logic should be pretty similar to the logic used by lynx and curl. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: fix arithmetic overflows in avformat_seek_file()Mans Rullgard2012-12-08
| | | | | | | | The values compared here can be more than INT64_MAX apart. Since the difference is always positive, converting to uint64_t before subtracting gives the correct result without overflows. Signed-off-by: Mans Rullgard <mans@mansr.com>
* Remove pointless #undefs of previously forbidden functions.Anton Khirnov2012-12-04
|
* lavf: add a common function for selecting a pcm codec from parametersJustin Ruggles2012-11-28
|
* lavf: avoid integer overflow in ff_compute_frame_duration()Janne Grunau2012-11-26
| | | | | | | | Scaling the denominator instead of the numerator if it is too large loses precision. Fixes an assert caused by a negative frame duration in the fuzzed sample nasa-8s2.ts_s202310. CC: libav-stable@libav.org
* url: Handle relative urls starting with two slashesDuncan Salerno2012-10-09
| | | | | | This is defined by RFC 3986 section 5.4.1 to be handled this way. Signed-off-by: Martin Storsjö <martin@martin.st>
* url: Handle relative urls being just a new query stringDuncan Salerno2012-10-09
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* url: Don't treat slashes in query parameters as directory separatorsDuncan Salerno2012-10-09
| | | | | | | Strip off query parameters from the original url before applying the new relative path. Signed-off-by: Martin Storsjö <martin@martin.st>
* Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormatAnton Khirnov2012-10-08
|
* avformat: split muxing functions from util.cLuca Barbato2012-10-01
|
* avformat: const correctness for av_hex_dump / av_hex_dump_logDiego Biurrun2012-10-01
|
* avformat: Convert some commented-out printf/av_log instances to av_dlogDiego Biurrun2012-10-01
|
* lavf: use a malloced AVFrame in try_decode_frame().Anton Khirnov2012-09-24
| | | | This allows using avcodec_free_frame() to free it properly.
* lavf: zero data/size of the packet passed to read_packet().Anton Khirnov2012-09-21
|
* lavf probe: prevent codec probe with no data at all seenJanne Grunau2012-09-20
| | | | | | This occurs with fuzzed mpeg-ts files. set_codec_from_probe_data() is called with a zeroed AVProbeData since no packet made through for specific stream.
* avformat: fix typo in avformat_close_inputLuca Barbato2012-09-15
| | | | The condition should not be &&.
* lavf: flush the output AVIOContext in av_write_trailer().Anton Khirnov2012-09-15
| | | | | | | This is consistent with stdio and is what we want to do in all cases. Fixes a bug in the voc muxer which didn't flush in write_trailer() previously. This is the cause of the change in the test results.
* lavf: cosmetics, reformat av_write_trailer().Anton Khirnov2012-09-15
|
* avformat: refactor avformat_close_inputLuca Barbato2012-09-14
| | | | Do not crash if the input format is not allocated yet.
* avformat: simplify avformat_close_inputLuca Barbato2012-09-14
| | | | avio_close checks by itself for NULL condition.
* libavformat: add const to AVCodec pointersMans Rullgard2012-08-18
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* lavf: Detect discontinuities in timestamps for framerate/analyzeduration ↵Martin Storsjö2012-08-12
| | | | | | | | | calculation If the dts difference is more than 1000 times the average dts difference, restart the analysis. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Initialize the stream info timestamps in avformat_new_streamMartin Storsjö2012-08-12
| | | | | | | | | | | These are normally initialized to AV_NOPTS_VALUE at the start of avformat_find_stream_info, but if a new stream is found while this function is running (e.g. like in mpegts), the newly added AVStreams didn't have these values properly initalized, leading to avformat_find_stream_info terminating too soon (when the first timestamps are far from 0). Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: simplify is_intra_only() by using codec descriptors.Anton Khirnov2012-08-11
|
* dict: add av_dict_count()Mans Rullgard2012-08-10
| | | | | | | | This adds a function to retrieve the number of entries in a dictionary and updates the places directly accessing what should be an opaque struct to use this new function instead. Signed-off-by: Mans Rullgard <mans@mansr.com>
* Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-07
|
* lavf: Declare an AVRational struct without a struct literalMartin Storsjö2012-08-06
| | | | | | | At this place, the normal way of initializing a struct works fine, there's no need for a struct literal. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: deprecate r_frame_rate.Anton Khirnov2012-07-29
| | | | | | | | | | | | | | | | | | | | According to its description, it is supposed to be the LCM of all the frame durations. The usability of such a thing is vanishingly small, especially since we cannot determine it with any amount of reliability. Therefore get rid of it after the next bump. Replace it with the average framerate where it makes sense. FATE results for the wtv and xmv demux tests change. In the wtv case this is caused by the file being corrupted (or possibly badly cut) and containing invalid timestamps. This results in lavf estimating the framerate wrong and making up wrong frame durations. In the xmv case the file contains pts jumps, so again the estimated framerate is far from anything sane and lavf again makes up different frame durations. In some other tests lavf starts making up frame durations from different frame.
* lavf: round estimated average fps to a "standard" fps.Anton Khirnov2012-07-29
|
* lavf: use dts difference instead of AVPacket.duration in find_stream_info()Anton Khirnov2012-07-29
| | | | | | | | | | AVPacket.duration is mostly made up and thus completely useless, this is especially true for video streams. Therefore use dts difference for framerate estimation and the max_analyze_duration check. The asyncts test now needs -analyzeduration, because the default is 5 seconds and the audio stream in the sample appears at ~10 seconds.
* avf: introduce nobuffer optionLuca Barbato2012-07-29
| | | | | | | | | | | | | Useful in cases where a significant analyzeduration is still needed, while minimizing buffering before output. An example is processing low-latency streams where all media types won't necessarily come in if the analyzeduration is small. Additional changes by Josh Allmann <joshua.allmann@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavf: remove commented out cruft in avformat_find_stream_info()Anton Khirnov2012-07-28
|
* Add missing libavutil/time.h includes.Anton Khirnov2012-07-28
|
* Move av_gettime() to libavutilMans Rullgard2012-06-20
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* lavf: don't segfault when a NULL filename is passed to avformat_open_input()Anton Khirnov2012-06-16
| | | | | | | | This can easily happen when the caller is using a custom AVIOContext. Behave as if the filename was an empty string in this case. CC: libav-stable@libav.org
* avformat: Probe codecs at score 0 on buffer exhaustion conditions.Alex Converse2012-06-05
|
* avformat: Factorize codec probing.Alex Converse2012-06-05
|
* avformat: Add a flag to mark muxers that allow (non strict) monotone timestamps.James Zern2012-05-20
| | | | Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
* lavf: make output format matching case insensitiveMans Rullgard2012-05-19
| | | | | | This is consistent with how input formats are matched. Signed-off-by: Mans Rullgard <mans@mansr.com>