summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* 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.
* mp3dec: Fix VBR bit rate parsingAlexander Kojevnikov2013-03-08
| | | | | | | | | | | | When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag. When parsing the stream, don't override the bit rate if it's already set, otherwise calculate the mean bit rate from parsed frames. This way, the bit rate will be set correctly both for CBR and VBR streams. CC:libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
* 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>
* rtpdec: Initialize some variables to silence compiler warningsMartin Storsjö2013-03-02
| | | | | | | | The warnings are false positives, older gcc versions (such as 4.5) think the variables can be used uninitialized while they in practice can't, while newer (4.6) gets it right. Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: Check the return value of a mallocMartin Storsjö2013-03-02
| | | | | | | | | | The callers of this function can't report errors sanely. If this one malloc fails, don't write the extradata byte, make sure we try to malloc it the next time we're called instead, and make sure we still consume the input data byte. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* flvdec: Don't read the VP6 header byte when setting codec type based on metadataMartin Storsjö2013-03-02
| | | | | | | | | This header byte is only present when actually reading a VP6 frame, not when reading the codec type field in the metadata. This potential bug has been present since 5b54a90c. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Add a fate test for the noproxy pattern matchingMartin Storsjö2013-02-27
| | | | 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>
* mov: use the format context for logging.Anton Khirnov2013-02-23
| | | | CC:libav-stable@libav.org
* asfdec: do not assume every AVStream has a corresponding ASFStreamAnton Khirnov2013-02-09
| | | | | | | This won't be true for ID3 attached picture. Also stop allocating now useless dummy ASFStreams for ASF native attached pictures.
* asfdec: support reading ID3v2 tags in ASF filesVladimir Pantelic2013-02-09
| | | | | | | Yes, these files do exist Signed-off-by: Vladimir Pantelic <vladoman@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: also read Metadata Library ObjectVladimir Pantelic2013-02-09
| | | | | | | | In some ASF files this objects holds cover art and other tags. Compared to Metadata Object it can also hold GUIDs, but we ignore these for now. Signed-off-by: Vladimir Pantelic <vladoman@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: read the full Metadata Object, not just aspect ratio informationVladimir Pantelic2013-02-09
| | | | | | | | Use the same get_tag()/get_value() as for the Extended Content Description but handle the 16 bit vs 32 bit difference for type 2 (BOOL) Signed-off-by: Vladimir Pantelic <vladoman@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: silence a warningVladimir Pantelic2013-02-09
| | | | | Signed-off-by: Vladimir Pantelic <vladoman@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asf: K&R formatting cosmeticsDiego Biurrun2013-02-06
|
* Use proper "" quotes for local header #includesDiego Biurrun2013-02-01
|
* bink demuxer: set framerate.Anton Khirnov2013-02-01
|
* bink demuxer: check malloc return valueAnton Khirnov2013-02-01
|
* avisynth: Change demuxer name to avoid conflicts with AVSDiego Biurrun2013-01-31
|
* movenc: Simplify code by using avio_wb24Martin Storsjö2013-01-30
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* mvi: set framerateAnton Khirnov2013-01-29
| | | | This container does not store timestamps and thus supports CFR only.
* rtpenc_chain: Use the original AVFormatContext for getting payload typeMartin Storsjö2013-01-24
| | | | | | | | | | | | | | | | | In ff_rtp_get_payload_type, the AVFormatContext is used for checking whether the payload_type or rtpflags options are set. In rtpenc_chain, the rtpctx struct is a newly initialized struct where no options have been set yet, so no options can be fetched from there. All muxers that internally chain rtp muxers have the "rtpflags" field that allows passing such options on (which is how this worked before 8034130e06), so this works just as intended. This makes it possible to produce H263 in RFC2190 format with chained RTP muxers. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* rtp: Make sure the output format pointer is setMartin Storsjö2013-01-24
| | | | | | | | Not sure if this actually happens, but we do the same check when checking payload_type further above in the function, so it might be needed. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtp: Make sure priv_data is set before reading itMartin Storsjö2013-01-23
| | | | | | | This fixes crashes with muxing H263 into RTSP. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc: fix overflow checking in avc_mp4_find_startcode()Xi Wang2013-01-23
| | | | | | | | | | | | The check `start + res < start' is broken since pointer overflow is undefined behavior in C. Many compilers such as gcc/clang optimize away this check. Use `res > end - start' instead. Also change `res' to unsigned int to avoid signed left-shift overflow. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: fix buffer overflows in ff_amf_tag_contents()Xi Wang2013-01-23
| | | | | | | | | | | | | | A negative `size' will bypass FFMIN(). In the subsequent memcpy() call, `size' will be considered as a large positive value, leading to a buffer overflow. Change the type of `size' to unsigned int to avoid buffer overflow, and simplify overflow checks accordingly. Also change a literal buffer size to use sizeof, and limit the amount of data copied in another memcpy call as well. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: fix multiple broken overflow checksXi Wang2013-01-23
| | | | | | | | | | | | Sanity checks like `data + size >= data_end || data + size < data' are broken, because `data + size < data' assumes pointer overflow, which is undefined behavior in C. Many compilers such as gcc/clang optimize such checks away. Use `size < 0 || size >= data_end - data' instead. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpenc: Start the sequence numbers from a random offsetMartin Storsjö2013-01-22
| | | | | | | | Expose the current sequence number via an AVOption - this can be used both for setting the initial sequence number, or for querying the current number. Signed-off-by: Martin Storsjö <martin@martin.st>
* avidec: use sensible error codes instead of -1Jindrich Makovicka2013-01-21
| | | | | | | | Use AVERROR_INVALIDDATA on invalid inputs, and AVERROR_EOF when no more frames are available in an interleaved AVI. Signed-off-by: Jindrich Makovicka <makovick@gmail.com> Signed-off-by: Diego Biurrun <diego@biurrun.de>
* srtp: Move a variable to a local scopeMartin Storsjö2013-01-21
| | | | | | This simplifies the code slightly. Signed-off-by: Martin Storsjö <martin@martin.st>
* srtp: Add tests for the crypto suite with 32/80 bit HMACMartin Storsjö2013-01-21
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* srtp: cosmetics: Use fewer lines for the test vectorsMartin Storsjö2013-01-21
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* srtp: Don't require more input data than what actually is neededMartin Storsjö2013-01-21
| | | | | | | | | | The theoretical minimum for a (not totally well formed) RTCP packet is 8 bytes, so we shouldn't require 12 bytes as minimum input. Also return AVERROR_INVALIDDATA instead of 0 if something that is not a proper packet is given. Signed-off-by: Martin Storsjö <martin@martin.st>
* srtp: Improve the minimum encryption buffer size checkMartin Storsjö2013-01-21
| | | | | | | This clarifies where the limit number comes from, and only requires exactly as much padding space as will be needed. Signed-off-by: Martin Storsjö <martin@martin.st>
* srtp: Add support for a few DTLS-SRTP related crypto suitesMartin Storsjö2013-01-21
| | | | | | | | The main difference to the existing suites from RFC 4568 is that the version with a 32 bit HMAC still uses 80 bit HMAC for RTCP packets. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec/srtp: Handle CSRC fields being presentMartin Storsjö2013-01-21
| | | | | | This is untested in practice, but follows the spec. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Check the return value from av_new_packetMartin Storsjö2013-01-21
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Move setting the parsing flags to the actual depacketizersMartin Storsjö2013-01-20
| | | | | | | This gets rid of almost all the codec specific details from the generic rtpdec code. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Split handling of mpeg12 audio/video to a separate depacketizerMartin Storsjö2013-01-20
| | | | | | This also adds checking of mallocs. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Split mpegts parsing to a normal depacketizerMartin Storsjö2013-01-20
| | | | | | | This gets rid of a number of special cases from the common rtpdec code. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec: Reorder payload handler registration alphabeticallyMartin Storsjö2013-01-20
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* mpegts: Share the cleanup code between the demuxer and lavf-internal parser ↵Martin Storsjö2013-01-20
| | | | | | | | | | | | | functions The lavf-internal parser functions are used when receiving mpegts over RTP. This fixes memory leaks in this setup. The normal mpegts demuxer close function was updated in ec7d0d2e in 2004 to fix leaks, but the parsing function used for RTP wasn't updated and has been leaking ever since. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_mpeg4: Return one AAC AU per AVPacketMartin Storsjö2013-01-20
| | | | | | | This makes the returned data valid to stream copy into other containers as well, not only for decoding straight away. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavc: support ZenoXVID custom tagLuca Barbato2013-01-17
| | | | | Looks like this kind of samples are produced by certain Russian equipment.
* idcin: fix memleaks in idcin_read_packet()Justin Ruggles2013-01-16
| | | | Fixes fate-id-cin-video failures when running FATE with valgrind.
* rtpdec_mpeg4: Check the remaining amount of data before readingMartin Storsjö2013-01-16
| | | | | | This fixes possible buffer overreads. Signed-off-by: Martin Storsjö <martin@martin.st>
* rtpdec_mpeg4: Check the return value from mallocMartin Storsjö2013-01-15
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* srtp: Mark a few variables as uninitializedMartin Storsjö2013-01-15
| | | | | | | This squelches false positive warnings (with gcc) about them being used uninitalized. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Add a fate test for the SRTP functionsMartin Storsjö2013-01-15
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* sdp: Include SRTP crypto params if using the srtp protocolMartin Storsjö2013-01-15
| | | | | | Also print port numbers for this protocol. Signed-off-by: Martin Storsjö <martin@martin.st>