Commit Graph

9864 Commits

Author SHA1 Message Date
Anton Khirnov
75647dea6f oggparseogm: check timing variables
Fixes a potential divide by zero.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:21:38 +01:00
Martin Storsjö
82b9799bb2 sdp: Check that fmt->oformat is non-null before accessing it
This avoids crashes when avserver tries to create an SDP, since
d77f4af.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-01-05 01:33:46 +02:00
Anton Khirnov
1b5d065ca7 pmpdec: check that there is at least one audio packet.
The code cannot handle there being none, but that should not happen for
valid files.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-03 16:40:22 +01:00
Diego Biurrun
b83d1ee3b4 avutil: Move library version related macros to version.h
This is a more sensible place for these macros.
2013-12-26 19:05:22 +01:00
Luca Barbato
1716b4c7b8 mms: Remove non-utf8 characters
Certain softwares get badly confused.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-12-26 06:07:35 +01:00
Justin Ruggles
be7c323176 Add a libwebp encoder 2013-12-21 17:01:42 -05:00
Luca Barbato
f412b2c9f3 flv: Use the correct type to hold the file offset 2013-12-20 17:44:20 +01:00
Luca Barbato
15739a9bd1 jvdec: Do not feed the decoder with known wrong data
Still assume the size value is right in non-explode mode.
2013-12-20 17:44:20 +01:00
Paul B Mahol
e518cb863e jvdec: Fix memory leak of jv->frames
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-12-20 17:44:20 +01:00
Luca Barbato
027712e851 jvdec: Return EOF on end of file 2013-12-20 17:44:20 +01:00
Michael Niedermayer
9aba0a6f7b rtpdec_h264: Check the return value of functions doing allocations
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-12-14 17:48:46 +02:00
Martin Storsjö
6451c8853a sdp: Check theora colorspace before producing the configuration string
This avoids a memory leak (or having to worry about freeing the
config string) if the colorspace isn't accepted.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-12-14 17:48:46 +02:00
Michael Niedermayer
797f2a7913 hdsenc: Check the init_file() return code
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-12-14 17:48:46 +02:00
Michael Niedermayer
b8ed15d637 hdsenc: Fix an off by one error in an array size check
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-12-14 17:48:42 +02:00
Michael Niedermayer
417927af3c hdsenc: Avoid integer overflow
Also remove a silly leftover pair of parentheses.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-12-14 17:48:28 +02:00
Carl Eugen Hoyos
9fa75be96d mpegts: add HEVC registration descriptor 2013-12-12 16:10:15 +01:00
Martin Lambers
ae9d13f03e img2: add stereo 3d still picture file extensions 2013-12-12 16:10:15 +01:00
Vittorio Giovara
46c0cbd5dc rtsp: suppress a incompatible pointer types warning 2013-12-12 16:10:14 +01:00
Rumin Sam
70e981cf5d rtspdec: Fix keep-alive request for ACTi cameras
Some ACTi cameras fail if "*" is passed as the URI.

Signed-off-by: Ismael Luceno <ismael.luceno@corp.bluecherry.net>
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-12-11 22:48:55 +02:00
Anton Khirnov
281a40e18f lavf: remove an unneeded call to avcodec_get_frame_defaults().
avcodec_decode_*() resets the frame itself.
2013-12-11 20:39:55 +01:00
Anton Khirnov
eb891b3114 Replace all uses of avcodec_free_frame with av_frame_free(). 2013-12-11 20:39:54 +01:00
Diego Biurrun
d64341e498 configure: Prefix libc-related variables with "libc_"
Simplifies host/target libc detection splitting.
2013-12-09 11:47:43 +01:00
d s
f0b234ab9e avformat: AviSynth demuxer rewrite
Directly loads AviSynth through LoadLibrary instead of relying on
Video for Windows, and supports using AvxSynth (via dlopen) to
open scripts on Linux and OS X.

Error messages from AviSynth/AvxSynth are now reported through
av_log and exit, rather than the traditional behavior of generating
an error video that the user would need to watch to diagnose.

The main rewrite was authored by d s <avxsynth.testing@gmail.com>
from the AvxSynth team, with additional contributions by

Oka Motofumi <chikuzen.mo@gmail.com>
Stephen Hutchinson <qyot27@gmail.com>
Diego Biurrun <diego@biurrun.de>
Anton Khirnov <anton@khirnov.net>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-08 21:54:50 +01:00
Anton Khirnov
95fd52c11b mxfdec: set extradata size
The line setting it was mistakenly removed in
ecf442a58b
2013-11-29 14:19:47 +01:00
Kostya Shishkov
a16577d985 MSN Audio support
This is essentially a MS GSM decoder extension that supports more
sampling rates and lower bitrates.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-26 08:31:10 +01:00
Diego Biurrun
ab81f24ad4 build: Integrate multilibrary examples into the build system
This includes moving libavformat/output-example to doc/examples/output.
2013-11-25 11:57:29 -08:00
Diego Biurrun
8f8bc92365 Add missing #includes for *INT64_MAX and *INT64_C 2013-11-23 21:55:52 +01:00
Martin Storsjö
56c2337004 hls: Avoid reading outside of the allocated array
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-22 14:27:10 +02:00
Martin Storsjö
8c92909814 hls: Check whether the AVIOContext contains a new redirected URL
This allows both the main playlist itself as well as the variant
playlists to handle redirects combined with relative URLs.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-22 14:27:08 +02:00
Martin Storsjö
be4edda673 http: Expose the content location via an AVOption
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-22 14:27:07 +02:00
Zhang Rui
393d80cc27 http: Support relative URL redirection
In RFC 2616, this was explicitly said to be an absolute URL,
while in an upcoming draft [1] it is allowed to be relative as well.

[1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-25#section-7.1.2

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-22 14:27:04 +02:00
Martin Storsjö
76267ecc82 http: Remove an unrelated and mistakenly set AVOption unit name
This was due to a copypaste oversight.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-22 14:27:01 +02:00
Anton Khirnov
ce9bba5340 avidec: fix a memleak in the dv init code.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2013-11-21 20:57:58 +01:00
Aurelien Jacobs
8b516f154a matroskadec: use correct compression parameters for current track CodecPrivate
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-21 20:54:55 +01:00
Anton Khirnov
30be1ea33e matroskadec: pad EBML_BIN data.
It might be passed to code requiring padding, such as lzo decompression.

Fixes invalid reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2013-11-21 20:54:30 +01:00
Valeriy Argunov
cc20fbcd39 rtmphttp: Check for both 0 and AVERROR_EOF
This makes RTMPT work again - it was broken by 5d876be87a.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-18 12:36:32 +02:00
Anton Khirnov
5b9c3b4505 Replace all instances of avcodec_alloc_frame() with av_frame_alloc(). 2013-11-16 12:44:20 +01:00
Diego Biurrun
3cbe112653 dv: Split DV data table declarations into their own header
This is necessary to avoid target config settings bleeding into the host
compilation process with hardcoded tables and the DV VLC tables no longer
present as static tables in a header file.
2013-11-15 01:29:47 +01:00
Reimar Döffinger
ecf442a58b lavf: improve support for AVC-Intra files.
Generate extradata with SPS/PPS based on container dimensions.

Authors of this commit are: Reimar and Thomas Mundt

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-14 18:59:39 +01:00
Marton Balint
951d819006 mxfdec: update current edit unit when seeking in mxf files without index tables
Fixes audio packet pts values in some files generated by AVID TRMG 3.01.

Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-14 18:59:17 +01:00
Anton Khirnov
d42db44cfe avienc: drop the vfr flag.
AVI does not really support vfr properly, only by padding with null
packets.
2013-11-08 21:02:29 +01:00
David Goldwich
0a7fef39fc omadec: loosen format probing constraints
Imporoves detection of some files in the wild:

- ID3v2 a.k.a. "ea3" header is optional.
- Version and flags in ID3v2 header are unspecified.

Signed-off-by: David Goldwich <david.goldwich@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-04 18:43:18 +01:00
Michael Niedermayer
1c736bedd9 omadec: check GEOB sizes against buffer size
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-04 18:43:03 +01:00
Michael Niedermayer
97f50e92b5 omadec: Fix wrong number of array elements
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: David Goldwich <david.goldwich@gmail.com>
CC:libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-04 18:38:01 +01:00
Vittorio Giovara
d763978583 rtmpproto: Reorder conditions to help dead code elimination
This makes sure that these branches are eliminated properly
with clang with optimizations disabled.
2013-11-03 11:51:41 +01:00
Vittorio Giovara
c0bba95c23 wtv: fix variable sign in format 2013-11-03 11:51:40 +01:00
Diego Biurrun
5928b29f53 os_support: Add #endif comments for better readability 2013-11-02 13:57:03 +01:00
Martin Storsjö
435214a757 Add an HDS live fragmenting muxer
HDS fragments basically are FLV fragments wrapped in an ISO
media mdat atom.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-02 10:51:00 +02:00
Anton Khirnov
d1c229cdbc lavf: do not use int to store an int64 2013-11-01 21:01:32 +01:00
Martin Storsjö
50aef03b24 rtspenc: Make sure BYE packets are sent before TEARDOWN
Also make sure the BYE packets are sent at all when using
TCP interleaved transport.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-01 09:57:06 +02:00
Martin Storsjö
9ceed7af37 rtpenc: Add a rtpflag option for sending BYE packets when finishing
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-01 09:57:02 +02:00
Martin Storsjö
b264453de9 rtpenc: Remove some superfluous parentheses
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-01 09:56:28 +02:00
Martin Storsjö
d07b51bf07 aviobuf: Handle a NULL buffer in avio_close_dyn_buf
This simplifies proper error handling in rtsp.c/rtspdec.c. When
broadcasting over RTSP in TCP mode, the AVIOContext is closed and
recreated for each sent packet, and if the recreation fails, we might
try to close a NULL buffer when freeing things at the end.

Previously, if recreating the buffer in rtspdec.c failed, this would
crash later due to trying to close a NULL buffer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-11-01 09:56:27 +02:00
Mickaël Raulet
b6a4701612 mpegts: Support HEVC demuxing
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-31 20:20:57 +01:00
Yusuke Nakamura
959bea13ce matroskadec: Support HEVC demuxing 2013-10-31 20:20:49 +01:00
Yusuke Nakamura
ea29f965dc mov: Support HEVC demuxing
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-31 20:20:32 +01:00
Dirk Farin
5846646296 Add raw HEVC demuxer
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-31 20:20:24 +01:00
Anton Khirnov
ce6949d3a0 oggparsetheora: stop using deprecated avcodec_set_dimensions 2013-10-31 20:14:14 +01:00
David Kment
9af7a8523a HNM4/HNM4A demuxer & video decoder
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-10-31 17:45:46 +01:00
Martin Storsjö
0c5f839693 lavf: Remove a now useless parameter to ffurl_register_protocol
This was added in 9b07a2dc02 as an ABI hack to allow older
code built with lavf 52 to register protocols even if the size
of the URLProtocol struct was increased. Later, registering
protocols from outside of lavf was removed and this workaround
isn't needed any longer since lavf 53.

This removes an unchecked malloc and a memory leak for the cases
when this workaround actually was used - which it hasn't since
lavf 53.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-30 09:53:48 +02:00
Anton Khirnov
4f2d8968c0 oggparsetheora: check av_mallocz result 2013-10-30 08:45:31 +01:00
Anton Khirnov
5e5fb21877 oggparsetheora: return meaningful error codes 2013-10-30 08:45:25 +01:00
Anton Khirnov
d4c12b8be4 oggparsetheora: K&R cosmetics, reformat
Also typedef the private data struct and make its name consistent with
the rest of Libav.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-30 08:45:10 +01:00
Anton Khirnov
8b64c2ba03 lavc: add a dummy field to AVStream to preserve ABI compatibility for avconv
avconv abuses the API by accessing AVStream.parser (which is private).
Removing AVStream.reference_dts in
2ba68dd044 breaks ABI compatibility for an
old avconv using a newer lavf. Fix this by adding a dummy field until
the next bump.
2013-10-29 14:19:10 +01:00
Derek Buitenhuis
25c7db7cc9 avio: Check for memory allocation failure of private data
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-29 11:40:15 +00:00
Anton Khirnov
feeafb4ada lavf: do not export av_register_{rtp,rdt}_dynamic_payload_handlers from shared objects 2013-10-28 15:29:49 +01:00
Anton Khirnov
2ba68dd044 lavf: remove unreliable timestamp guessing heuristic 2013-10-28 09:28:19 +01:00
Luca Barbato
53151723e3 avio: K&R formatting cosmetics 2013-10-28 00:04:50 +01:00
Clément Bœsch
e01fba5562 movenc: Add an F4V muxer
F4V is Adobe's mp4/iso media variant, with the most significant
addition/change being supporting other flash codecs than just
aac/h264.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-23 11:17:03 +03:00
Derek Buitenhuis
b1fcdc08ce nut: Fix unchecked allocations
CC: libav-stable@libav.org
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-22 17:09:56 +01:00
Luca Barbato
ea71aafd68 avio: Use AVERROR_PROTOCOL_NOT_FOUND
When the protocol is missing ffurl_alloc() should return
AVERROR_PROTOCOL_NOT_FOUND instead of AVERROR(ENOENT).

Bug-Id: 577
CC: libav-stable@libav.org
2013-10-21 15:55:20 +02:00
Luca Barbato
2b72f8ac32 wtv: Seek by sector properly
Use an helper function to seek by sector to avoid possible mistakes
due shifting by WTV_SECTOR_BITS a 32bit integer.

Contrary to common intuition, a 32 bit integer left shifted
by a 64 bit integer does not promote the 32 bit integer to
64 bit before shifting.
2013-10-18 15:08:18 +02:00
Michael Niedermayer
708b32b6f7 http: Check the auth string contents and not only the pointer
This makes sure we don't send the Except: 100-continue header
if no authentication credentials have been provided.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-14 21:57:15 +03:00
Martin Storsjö
84a125c4c2 rtmp: Allocate the prev_pkt arrays dynamically
Normally, all channel ids are between 0 and 10, while they in
uncommon cases can have values up to 64k.

This avoids allocating two arrays for up to 64k entries (at a total
of over 6 MB in size) each when most of them aren't used at all.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-14 14:27:35 +03:00
Martin Storsjö
71549a857b http: Support auth method detection for POST
Inspired by a patch by Jakob van Bethlehem. But instead of doing
an empty POST first to trigger the WWW-Authenticate header (which
would succeed if no auth actually was required), add an Expect:
100-continue header, which is meant to be used exactly for
cases like this.

The header is added if doing a post, and the user has specified
authentication but we don't know the auth method yet.

Not all common HTTP servers support the Expect: 100-continue header,
though, so we only try to use it when it really is needed. The user
can request it to be added for other POST requests as well via
an option - which would allow the caller to know immediately that
the POST has failed (e.g. if no auth was provided but the server
required it, or if the target URL simply doesn't exist).

This is only done for write mode posts (e.g. posts without pre-set
post_data) - for posts with pre-set data, we can just redo the post
if it failed due to 401.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-13 12:59:03 +03:00
Martin Storsjö
eb8b05a382 http: Add an option for forcing basic authentication
The default is to autodetect the auth method. This does require one
extra request (and also closing and reopening the http connection).
For some cases such as HTTP POST, the autodetection is not handled
properly (yet).

No option is added for digest, since this method requires getting
nonce parameters from the server first and can't be used straight
away like Basic.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-13 12:59:03 +03:00
Vittorio Giovara
fd2384f02b oggparsevorbis: fail on memory allocation error 2013-10-12 15:37:56 +02:00
James Almer
c18375ec80 oggvorbisdec: add support for embedded cover art
Signed-off-by: James Almer <jamrial@gmail.com>
2013-10-12 15:34:10 +02:00
James Almer
601d6228c4 flac: move picture parsing code in a separate file
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-12 15:30:39 +02:00
Nicolas George
ecab1c7741 oggdec: add support for Opus in Ogg demuxing 2013-10-12 15:25:18 +02:00
Vittorio Giovara
ed9245dba8 oggparsevorbis: check allocations
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-12 15:24:26 +02:00
James Almer
9c15ef35d4 oggparsevorbis: support official chapter extension
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-12 15:24:08 +02:00
Martin Storsjö
a52b5a5a07 riff: Add a mapping for VP6A
This allows demuxing VP6A from F4V files.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-12 13:02:45 +03:00
Matthieu Bouron
054454c63a mxf: Add jpeg2000 codec to intra only codecs
Conform with SMPTE RP 224 and SMPTE s422.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-10 18:22:46 +02:00
Martin Storsjö
e6ed866859 flvenc: Write proper cropping for VP6 even if there's no extradata
This keeps cropping when remuxing from F4V to FLV.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-10 10:42:28 +03:00
Martin Storsjö
be1e1373d2 flvenc: Support muxing VP6A as well
Handle it in the same way as VP6F, except for the codec tag.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-10 10:42:10 +03:00
Martin Storsjö
4d7aeff9a1 flvenc: Don't pretend to support muxing "plain" VP6
The plain VP6 format is vertically flipped compared to VP6F/VP6A.
Support for the plain VP6 format was added in 09d8c0ae83 (which
also introduced support for muxing VP6F properly in general).

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-10 10:41:44 +03:00
Luca Barbato
ceec6e792e avi: directly resync on DV in AVI read failure
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-10-10 07:28:17 +02:00
Luca Barbato
756547ce7f avi: DV in AVI must be considered single stream
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-10-10 07:28:03 +02:00
Luca Barbato
1cac9accbd avi: properly fail if the dv demuxer is missing
CC: libav-stable@libav.org
2013-10-10 07:27:50 +02:00
Diego Biurrun
9adbc3f3a1 bmv: Remove unused variable 2013-10-06 19:36:53 +02:00
Vittorio Giovara
90e15e340d oggparsevorbis: return meaningful errors
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-10-05 23:16:48 +02:00
Martin Storsjö
b698542ad8 mov: Don't allocate arrays with av_malloc that will be realloced
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-05 00:00:43 +03:00
Martin Storsjö
cd818b3a57 rtmpproto: Validate the embedded flv packet size before copying
This wasn't an issue prior to 58404738, when the whole RTMP packet
was copied at once and the length of the individual embedded flv
packets only were validated by the flv demuxer.

Prior to this patch, this could lead to reads and writes out of bound.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-04 09:25:10 +03:00
Martin Storsjö
8921e32f73 rtmpproto: Readjust the end of the flv buffer if handle_metadata exited early
If the embedded flv packets were incomplete and we aborted the
copying loop early, make sure the flv buffer is trimmed to
only contain full packets.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-04 09:25:08 +03:00
Martin Storsjö
24fee95321 rtmpproto: Move the flv header/trailer addition to append_flv_data
update_offset is also called from handle_metadata, where the
packet header sizes is already included in the size.

Previously this lead to flv_data/flv_size including 15 uninitialized
bytes at the end after each call to handle_metadata, making the
flv demuxer lose sync with the stream.

Also remove leftover copying in handle_metadata. This is a leftover
from the refactoring in 5840473. (Previously this final mempcy was
the one that copied all the packets at once, while this is done
within the loop right now.) After making sure flv_size is set to
the right size, this write was out of bounds.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-04 09:25:07 +03:00
Martin Storsjö
72540e514c rtmpproto: Clear the flv allocation size on reallocp failures
This was overlooked in d872fb0f7 since I assumed all the realloc
issues in the rtmp code was fixed already.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-04 09:25:06 +03:00
Martin Storsjö
4d6d70292e rtmpproto: Pass the 'live' parameter in the right unit
The current magic numbers passed are values in seconds, while the
parameter itself should be passed over the wire in milliseconds.

This makes (some/all?) live streams from Red5 work correctly, that
previously returned StreamNotFound even with "-rtmp_live live". After
this commit, the default 'any' also works on these streams.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-04 09:25:05 +03:00
Martin Storsjö
a6b361325f rtmpproto: Print the error code string if there's no description
On (certain streams/setups at least on) Red5, the description string
actually is present, but empty. Therefore, first try loading the
description, but if not found or empty, load the code string instead.
The code string is quite understandable in most cases anyway (like
"NetStream.Play.StreamNotFound").

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-04 09:25:04 +03:00
Vittorio Giovara
49fe9c05f9 oggparsevorbis: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-10-03 23:26:09 +02:00
Diego Biurrun
47b6cfc2a0 avformat/output-example: Declare link dependency on libswscale in the Makefile 2013-10-03 23:23:04 +02:00
Luca Barbato
628a17d78a rtmp: alias rtmp_listen to listen
Make it uniform with the other protocols.
2013-10-01 15:42:06 +02:00
Luca Barbato
ad0560fe74 mxf: Remove a typo
Introduced in 93370d1216
2013-10-01 13:43:48 +02:00
Martin Storsjö
cc41167aed asfdec: Check the return value of asf_read_stream_properties
This makes sure errors in setting stream parameters are passed
on to the caller. This avoids successfully opening files while
some parameters aren't filled in properly.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-30 10:48:58 +03:00
Maxim Poliakovski
487b54104a omadec: fix bitrate for ATRAC3+ streams
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-29 21:54:51 +02:00
Maxim Poliakovski
23d0fdcf6f Add support for multichannel ATRAC3+ streams.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-29 21:52:57 +02:00
Anton Khirnov
93370d1216 mxfdec: set audio timebase to 1/samplerate
Fixes sync in some samples (e.g. bugs 7581 and 8374 in VLC).
Based on a commit by Matthieu Bouron <matthieu.bouron@gmail.com>

Reported-by: Jean-Baptiste Kempf <jb@videolan.org>
CC: libav-stable@libav.org
2013-09-29 21:50:30 +02:00
Martin Storsjö
c231987662 mov: Make sure the read sample count is nonnegative
This avoids setting a negative number of frames, ending up with a
negative average frame rate.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 20:00:45 +03:00
Martin Storsjö
640a2427aa bfi: Add some very basic sanity checks for input packet sizes
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 19:59:32 +03:00
Martin Storsjö
9fc7184d1a bfi: Avoid divisions by zero
If a zero-length video packet is to be returned, just return
AVERROR(EAGAIN) and switch back to the audio stream.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 19:58:56 +03:00
Martin Storsjö
a9221e3960 electronicarts: Add more sanity checking for the number of channels
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 19:58:41 +03:00
Martin Storsjö
d07aa3f02b riffdec: Add sanity checks for the sample rate
This avoids a division by zero for G726.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 19:58:18 +03:00
Martin Storsjö
28ff439efd mvi: Add sanity checking for the audio frame size
This avoids a division by zero.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 19:57:43 +03:00
Martin Storsjö
adc09136a4 xwma: Avoid division by zero
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 19:56:44 +03:00
Martin Storsjö
8d07258bb6 avidec: Make sure a packet is large enough before reading its data
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 19:56:22 +03:00
Martin Storsjö
68ff998128 vqf: Make sure the bitrate is in the valid range
Even if the sample rate is valid, an invalid bitrate could
pass the mode combination test below.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 18:46:39 +03:00
Martin Storsjö
9277050e29 vqf: Make sure sample_rate is set to a valid value
This avoids divisions by zero later (and possibly assertions in
time base scaling), since an invalid rate_flag combined with an
invalid bitrate below could pass the mode combination test.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-29 18:46:21 +03:00
Luca Barbato
5c349ad08a lxf: check the nb_streams instead of relying on padding
Remove the now unneeded stream pointer while at it.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-09-27 01:33:46 +02:00
Paul B Mahol
a529fa2f4d lxf: remove deplanarization hack
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-09-27 01:33:46 +02:00
Paul B Mahol
7e52080cb1 pcm: support 24-bit/32-bit little-endian planar
Used by LXF.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-27 01:33:45 +02:00
Carl Eugen Hoyos
839df90c71 lxf: Support 16-channel files
Reported, analyzed and tested by Gabriel Gerard.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-27 01:33:45 +02:00
Reimar Döffinger
779951cd2c lxf: Support version 1 files
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-27 01:33:45 +02:00
Martin Storsjö
d872fb0f7f lavf: Reset the entry count and allocation size variables on av_reallocp failures
When av_reallocp fails, the associated variables that keep track of
the number of elements in the array (and in some cases, the
separate number of allocated elements) need to be reset.

Not all of these might technically be needed, but it's better to
reset them if in doubt, to make sure variables don't end up
conflicting.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-26 23:14:03 +03:00
Martin Storsjö
06ebc0bf9a lavf: Allocate arrays with av_realloc if they will be realloced later
Pointers returned from av_malloc can't in general be passed
to av_realloc.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-26 23:13:53 +03:00
Martin Storsjö
1af78b865b rtpdec_qt: Add an accidentally removed allocation return value check
This check was mistakenly removed in 5626f994f.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-26 23:13:50 +03:00
Martin Storsjö
705b748e8d tls: Add support for listen mode
Also add options for specifying a certificate and key, which can
be used both when operating as client and as server.

Partially based on a patch by Peter Ross.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-26 23:13:35 +03:00
Martin Storsjö
5c53bf7aaf http: Pass options through to the nested protocol
When passing a dict to the nested protocol, it will consume
the used options from it, so a separate copy needs to be used
when reopening the connection multiple times.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-26 23:13:16 +03:00
Martin Storsjö
8b09d917e7 tls: Add options for verifying the peer certificate
A file containing the trusted CA certificates needs to be
supplied via the ca_file AVOption, unless the TLS library
has got a system default file/database set up.

This doesn't check the hostname of the peer certificate with
openssl, which requires a non-trivial piece of code for
manually matching the desired hostname to the string provided
by the certificate, not provided as a library function.

That is, with openssl, this only validates that the received
certificate is signed with the right CA, but not that it is
the actual server we think we're talking to.

Verification is still disabled by default since we can't count
on a proper CA database existing at all times.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-26 23:13:06 +03:00
Anton Khirnov
668643b923 matroskadec: check av_strdup() when setting defaults 2013-09-24 17:11:50 +02:00
Martin Storsjö
b6c7bd53f4 movenchint: Clear size and len if the realloc failed
Previously these were left in an inconsistent state.

Pointed out by Michael Niedermayer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 21:02:52 +03:00
Martin Storsjö
f2b00a5372 movenc: Return a proper error code for invalid combinations
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 21:02:52 +03:00
Martin Storsjö
f7e616959a electronicarts: Check packet sizes before reading
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 21:02:52 +03:00
Martin Storsjö
ce67f442be lavf: Avoid setting avg_frame_rate if delta_dts is negative
This avoids setting avg_frame_rate to invalid (negative)
values.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 21:02:52 +03:00
Martin Storsjö
f1eac2b8a0 movenc: Use keyframes as default fragmentation point in ismv
Fragmenting blindly to a certain duration isn't a good choice
if one should be able to switch between different qualities,
therefore default to keyframes instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 16:10:21 +03:00
Martin Storsjö
a9553bbb33 movenc: Set all implicit flags immediately in mov_write_header
This makes sure other sanity checks for conflicting options
can work properly, e.g. for the conflict between the faststart
flag when using the ismv mode.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 16:10:21 +03:00
Martin Storsjö
187023f6b2 movenc: Set mov->mode earlier in mov_write_header
This allows simplifying some early checks that depend on the
muxer mode.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 16:10:21 +03:00
Martin Storsjö
5055035670 tls: Do not abort on non-fatal TLS alerts with gnutls
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-22 16:10:21 +03:00
Luca Barbato
c951e4b442 flv: Make onTextData parsing robust
Certain streaming servers do not preserve the order of the fields.
2013-09-22 01:10:17 +02:00
Luca Barbato
ba77757a7e rtmp: Replace a magic number with a macro
11 is the RTMP header size.
2013-09-22 01:09:33 +02:00
Luca Barbato
5840473890 rtmp: Rewrite embedded flv handling
Use update_offset() as done for rtmp audio, video and notifications and
read update and write the fields instead of replacing them in the rtmp
packet and then memcpying it to the output buffer.
2013-09-22 01:09:33 +02:00
Luca Barbato
e40a0e8228 rtmp: Refactor get_packet 2013-09-22 01:09:33 +02:00
Luca Barbato
32a414f316 rtmp: Support AMF_DATA_TYPE_MIXEDARRAY
And fix the AMF_DATA_TYPE_ARRAY parsing while at it.

A MIXEDARRAY type, as the ARRAY, store the number of elements in
an uint32 before the list. The ARRAY is strict and does not have
an OBJECT terminator, MIXEDARRAY behaves like an OBJECT type and
a different than stated number of element can be present.
2013-09-22 01:06:42 +02:00
Vittorio Giovara
944c338430 h264dec: Add .avc file name extension
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-20 21:08:02 +02:00
Vittorio Giovara
01f111bdb2 h264dec: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-20 21:06:23 +02:00
Luca Barbato
5532ee6d7d rtmp: Unbreak get_packet
Commit 5626f994f2 broke it.
2013-09-20 13:38:22 +02:00
Martin Storsjö
b97b1adb3f rtmpproto: Add a comment explaining the logic in handle_notify
This explains why the cleanup in 5626f994f was wrong and why
ae0f316a was needed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-20 10:47:15 +03:00
Martin Storsjö
d8798276b6 r3d: Add more input value validation
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:47:26 +03:00
Martin Storsjö
3ca14aa596 rl2: Avoid a division by zero
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:47:00 +03:00
Martin Storsjö
83c285f880 wtv: Add more sanity checks for a length read from the file
Also make sure the existing length check can't overflow.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:46:35 +03:00
Martin Storsjö
d8b6866014 yop: Clear all references to the AVBuffer in the local AVPacket
This makes sure that it doesn't try to free an AVBuffer belonging
to an earlier packet when we free the local packet at the end.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:46:21 +03:00
Martin Storsjö
82e266c6d3 segafilm: Validate the number of audio channels
This avoids divisions by zero later.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:45:40 +03:00
Martin Storsjö
72fe16a13e movenc: Use null buffers for measuring the amount of data to be written
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:42:40 +03:00
Martin Storsjö
3627ce2f1d aviobuf: Add functions for null buffers
Null buffers are useful for simulating writing to a real buffer
for the sake of measuring how many bytes are written.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 22:42:37 +03:00
Vladimir Pantelic
bb461370e3 asfenc: mux chapters in ASF files using an ASF "marker" section
ASF markers only have a start time, so we lose the chapter end times,
but that is ASF for you

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-19 19:51:49 +02:00
Vladimir Pantelic
09f3c937ed asfenc: remember send time and offset of the index entries
Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-19 19:37:59 +02:00
Vladimir Pantelic
1eb9328030 asfenc: add ASF_Reserved_4 as defined in section 10.10 of the ASF spec
Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-19 19:37:46 +02:00
Vladimir Pantelic
c53b5dda35 asfdec: replace magic constant with DATA_HEADER_SIZE
Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-19 19:37:37 +02:00
Vladimir Pantelic
5f40833360 asfdec: substract preroll time from marker presentation time
this was forgotten when we changed ASF to not output the preroll time

Signed-off-by: Vladimir Pantelic <vladoman@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-19 19:37:28 +02:00
Martin Storsjö
bcbe4f3ceb idroqdec: Make sure a video stream has been allocated before returning packets
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-19 11:09:04 +03:00
Luca Barbato
ae0f316a47 rtmp: Unbreak handle_notify
Commit 5626f994f2 broke it.
2013-09-19 09:13:04 +02:00
Justin Ruggles
c4bfa09807 Add a WebP decoder
Container and lossy decoding by Aneesh Dogra <aneesh@sugarlabs.org>
Lossless decoding by Justin Ruggles <justin.ruggles@gmail.com>
2013-09-18 14:10:05 -04:00
Alexandra Khirnova
5626f994f2 avformat: Use av_reallocp() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-18 18:28:38 +02:00
Martin Storsjö
0f310a6f33 rmdec: Validate the fps value
Abort if it is invalid if strict error checking has been requested.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-18 11:30:06 +03:00
Martin Storsjö
e7bf085b78 movenc: Add an option for omitting the tfhd base offset
This makes the output fragments independent of their position in
the output stream, making the output work better when streamed.

QuickTime Player doesn't support fragmented mp4 without the base
data offset, though.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 23:30:31 +03:00
Martin Storsjö
a4adabb460 movenc: Write the moof atom in two passes
This is a bit more work, but avoids having to fill in
the data offset field afterwards instead of directly when
the rest of the trun atom is written.

This simplifies future cases where this field needs to be set to
something different.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 23:25:46 +03:00
Josh Allmann
8583b14252 rtmp: Support reading interleaved chunks.
A given packet won't always come in contiguously; sometimes
they may be broken up on chunk boundaries by packets of another
channel.

This support primarily involves tracking information about the
data that's been read, so the reader can pick up where it left
off for a given channel.

As a side effect, we no longer over-report the bytes read if
(toread = MIN(size, chunk_size)) == size

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 23:19:11 +03:00
Martin Storsjö
d4c2a3740f xmv: Add more sanity checks for parameters read from the bitstream
Since the number of channels is multiplied by 36 and assigned to
to a uint16_t, make sure this calculation didn't overflow. (In
certain cases the calculation could overflow leaving the
truncated block_align at 0, leading to divisions by zero later.)

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 20:09:25 +03:00
Martin Storsjö
dc4acc8200 rtmpproto: Extend a comment to explain the prev_pkt arrays roles
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 20:09:25 +03:00
Martin Storsjö
647d655d19 rtmpproto: Consistently use the right prev_pkt array
prev_pkt[0] is used for input packets, while prev_pkt[1] is
used for output.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 20:09:24 +03:00
Martin Storsjö
0d3784396b rtmpproto: Check for the right return code
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 20:09:22 +03:00
Martin Storsjö
7f8d41eb09 mov: Don't use a negative duration for setting other fields
Some files have the duration set to -1 in the mdhd atom, more
or less legitimately. (We produce such files ourselves, for the
initial duration in fragmented mp4 files.)

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:33:37 +03:00
Martin Storsjö
19b9659f31 oggparseogm: Convert to use bytestream2
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:33:37 +03:00
Martin Storsjö
569d18aa9d matroskadec: Verify realaudio codec parameters
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:22:30 +03:00
Josh Allmann
f8d1bb6723 rtmp: rename main_channel_id to stream_id.
This more closely corresponds to the usage of the field.
Its usage here is unrelated to the channel ID.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:03:36 +03:00
Josh Allmann
d4aef99780 rtmp: Follow Flash player numbering for channels.
Channel 4 is typically used by the Flash player to transmit
audio, channel 6 for video, and various stream-specific invokes
get sent over channel 8, which is designated the source channel.

This more closely matches the behavior of the Flash player,
including the transmission of play requests over channel 8.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:03:36 +03:00
Josh Allmann
120af23cd5 rtmp: Send video on a separate channel.
Sending non-monotonic packets (e.g. when the audio and video
streams are monotonic within themselves but not muxed
monotonically) will lead to negative values the RTMP timestamp
field (where timestamps are transmitted only as deltas for each
channel), and this delta can end up being incorrectly written as
a large unsigned number.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 11:03:36 +03:00
Alexandra Khirnova
68b4677420 lavf: Make probe_codec return an error code
This allows handling errors from av_realloc properly.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 22:28:23 +03:00
Clément Bœsch
7308439158 lavf: Don't explicitly flush after each written packet in muxers
Since 596e5d4783, this is not necessary anymore. It also allows to
actually disable the flushing, improving write performance (but
possibly giving worse latency in real-time streaming).

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 22:17:33 +03:00
Luca Barbato
596e5d4783 lavf: Add a flag to enable/disable per-packet flushing
This is enabled by default and can be disabled with
"-fflags -flush_packets".

Inspired by a patch from Nicolas George <nicolas.george@normalesup.org>.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 22:11:08 +03:00
Luca Barbato
0a9425d7cf flv: Do not export datastream as metadata
It is used internally.
2013-09-16 19:36:37 +02:00
Luca Barbato
92ed83e393 rtmp: Store all the notify messages
The onTextData is used to implement text data streams in flv.
2013-09-16 19:36:37 +02:00
Luca Barbato
fe0337e89b rtmp: Do not send the first field twice within the handshake 2013-09-16 19:36:37 +02:00
Luca Barbato
666ed7eda1 rtmp: Drop an unneeded warning
Apparently a widely used streaming server requires that the second
field always presents a version during C1 phase.
2013-09-16 19:36:37 +02:00
Luca Barbato
ffb7669e47 rtmp: Support play method in listen mode 2013-09-16 19:36:37 +02:00
Luca Barbato
97d35fa89f rtmp: Factor out publish specific code
Will be reused for supporting play.
2013-09-16 19:36:37 +02:00
Martin Storsjö
5bbfe193a0 vocdec: Don't update codec parameters mid-stream
If we really want to support parameter changes, they need to be
signalled along with the AVPackets as parameter change side data,
not just changing the AVCodecContext parameters when a packet
is demuxed (since there may be other earlier packets yet undecoded).

Something similar was already done for the sample rate in 0883109b2,
but some parameters were left changeable.

This avoids having to recheck the channel count for validity for
each decoded frame in (ad)pcm decoders, unless the decoders
explicitly say that they accept parameter changes.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 11:04:52 +03:00
Martin Storsjö
0ef1660a63 sierravmd: Do sanity checking of frame sizes
Limit the size to INT_MAX/2 (for simplicity) to be sure that
size + BYTES_PER_FRAME_RECORD won't overflow.

Also factorize other existing error return paths.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 11:04:52 +03:00
Martin Storsjö
342c43d154 omadec: Properly check lengths before incrementing the position
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 11:04:52 +03:00
Alexandra Khirnova
00a63bfb87 matroskaenc: Fix stray pointers left over from av_reallocp_array refactoring
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-12 13:16:15 +02:00
Vittorio Giovara
c0779a67e8 mp3: add .mpa extension
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-12 13:16:15 +02:00
Martin Storsjö
17d57848fc mpc8: Make sure the first stream exists before parsing the seek table
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-12 10:54:27 +03:00
Martin Storsjö
459f2b393a mpc8: Check the seek table size parsed from the bitstream
Limit the size to INT_MAX/2 (for simplicity) to be sure that
size + FF_INPUT_BUFFER_PADDING_SIZE won't overflow.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-12 10:54:05 +03:00
Martin Storsjö
183b9d843a ape: Don't allow the seektable to be omitted
The seektable is required for filling in ape->frames[i].pos
further down.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-12 10:53:25 +03:00
Martin Storsjö
710b0e2702 smacker: Avoid integer overflow when allocating packets
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-11 20:19:43 +03:00
Martin Storsjö
8d928023f9 smacker: Don't return packets in unallocated streams
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-11 20:19:12 +03:00
Martin Storsjö
48d6556dd4 dsicin: Add some basic sanity checks for fields read from the file
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-11 20:18:55 +03:00
Alexandra Khirnova
f369b9356c avformat: Use av_reallocp_array() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-10 12:38:32 +02:00
Martin Storsjö
bdf990425e movenc: Simplify setting the fragmentation flag
This makes sure the faststart vs fragmentation check works as
intended when fragmentation is enabled due to using the ismv mode.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-09 23:58:33 +03:00
Martin Storsjö
8b524ab0c4 movenc: Add a warning message if conflicting options have been specified
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-09 23:57:41 +03:00
Martin Storsjö
a6a4596e12 tcp: Explicitly convert a pointer to a boolean integer
This fixes warnings about making integers from pointers without
a cast, and avoids the theoretical case where the lower 32 bits of
the pointer would all be zero where the implicit cast wouldn't give
the right result.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-09 23:57:04 +03:00
Anton Khirnov
26f027fba1 lavf: fix the comparison in an overflow check
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-09-07 11:52:40 +02:00
Luca Barbato
7ee191cab0 dv: Add a guard to not overread the ppcm array
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-09-07 11:18:01 +02:00
Diego Biurrun
c16ddcc90b avisynth: K&R formatting cosmetics 2013-09-06 11:13:36 +02:00
Diego Biurrun
97b052e568 avisynth: Add missing #include for NULL_IF_CONFIG_SMALL 2013-09-06 09:09:07 +02:00
John Stebbins
26b241c079 matroskaenc: Allow chapters to be written in trailer
This allows creation of frame accurate chapter marks from sources like
DVD and BD where the precise chapter location is not known until the
chapter mark has been reached during reading.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-04 20:30:43 +02:00
Martin Storsjö
d719981273 4xm: Check that the read track value is non-negative
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-03 22:57:36 +03:00
Martin Storsjö
5bcd3ae5b1 matroskadec: Check that .lang was allocated and set before reading it
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-03 22:57:15 +03:00
Martin Storsjö
0fbda03e5c movenc: Don't flush after each written packet
This should improve write performance quite significantly.
---
Tested with both writing a normal mp4, by using the faststart
feature and writing a fragmented mp4 file; all turn out with the
same md5sum as before.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-03 10:36:17 +03:00
Diego Biurrun
7df9e693a3 cosmetics: Fix ATRAC codec name spelling 2013-09-02 21:38:57 +02:00
Anton Khirnov
488b2984fe ape demuxer: check for EOF in potentially long loops
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-09-02 19:28:55 +02:00
Anton Khirnov
a7c1689ded 4xm: check that bits per sample is strictly positive
Avoids a divide by zero.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-09-02 19:28:47 +02:00
Anton Khirnov
df33a58e53 lavf: avoid integer overflow when estimating bitrate
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-09-02 19:28:29 +02:00
Anton Khirnov
fab694dd39 lavf: move a variable declaration to the block where it's used 2013-09-02 19:28:19 +02:00
Christian Schmidt
a42e3a6700 pcm_dvd: consolidate pieces from pcm.c and mpeg.c
Remove the header decoding for PCM audio from mpeg.c and the
20/24bit parts from pcm.c and merge them into a new decoder in
pcm-dvd.c.

The decoder has added support for samples that span multiple
packets and modified 20/24bit group decoding. Both is needed to
decode samples that have been generated with DVD-Lab Pro 2. The
decoding of 16bit PCM and two channel 24bit is identical to
before. No other samples are known to verify the correctness of
the encoding this software does.
The complete list of tested formats is
48kHz/16bit/2-8 channels
48kHz/24bit/2-5 channels
96kHz/16bit/2-4 channels
96kHz/24bit/2 channels

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-31 11:26:29 +02:00
Martin Storsjö
6454c44f9f rtmpproto: Fix limelight authentication with abbreviated app names
When streaming to limelight, the app name is either a full
"appname/subaccount" or "appname/_definst_". In the latter case,
the app name can be simplified into simply "appname", but the
authentication hashing assumes the /_definst_ still to be present.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-28 17:54:51 +03:00
Martin Storsjö
310cc4bf82 smoothstreamingenc: Write to a temp file while updating the manifest
If a client tries to read the file while it's being updated, the client
would get an incomplete manifest. Instead write to a separate temp file
and atomically rename it to replace the previous one.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-27 19:44:31 +03:00
Luca Barbato
f4634ae8a8 flv: Fix the help string 2013-08-27 14:38:54 +02:00
John Stebbins
f812eeda17 matroskaenc: Fix writing TRACKDEFAULTFLAG
The element was only being written when the value == 1.  But the default
value of this element is 1, so this has no useful effect.  This element
needs to be written when the value == 0.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-08-27 14:00:31 +02:00
Martin Storsjö
0fb3e1c6ce movenc: Check for errors from mov_create_chapter_track
On failures in the write_trailer function, we could also ignore
the errors and try to finish the file despite these errors (which
would only leave an incomplete chapters track). It's probably better
to signal the error clearly to the caller though (and if this
function failed there's no guarantee that there's enough memory to
finish the trailer either).

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-27 10:26:10 +03:00
Martin Storsjö
2bbad1f94c movenc: Properly free allocated data on failures in mov_write_header
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-27 10:26:08 +03:00
Martin Storsjö
3559fb97c4 movenc: Check that tracks->enc exists before trying to free extradata
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-27 10:26:07 +03:00
Martin Storsjö
4d122b01e4 movenc: Check for allocation failures in mov_create_chapter_track
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-27 10:25:55 +03:00
Luca Barbato
b89e8759e0 mov: Write tmcd extradata 2013-08-25 13:49:21 +02:00
Luca Barbato
5b41eb91e0 mov: Parse tmcd extradata 2013-08-25 13:49:13 +02:00
Luca Barbato
0b5af5cf12 mov: Refactor multiple stsd skipping in mov_mov_skip_multiple_stsd 2013-08-24 17:02:23 +02:00
Luca Barbato
08504380dd mov: Refactor codec specific final steps in mov_finalize_stsd_codec 2013-08-24 17:02:23 +02:00
Luca Barbato
dc518a3ae2 mov: Refactor subtitle specific parsing in mov_parse_stsd_subtitle 2013-08-24 17:02:23 +02:00
Luca Barbato
ef196beeb5 mov: Refactor audio specific parsing in mov_parse_stsd_audio 2013-08-24 17:02:23 +02:00
Luca Barbato
a3b53ff062 mov: Refactor video specific parsing in mov_parse_stsd_video 2013-08-24 17:02:23 +02:00
Luca Barbato
bf98562505 mov: Refactor codec id selection in mov_codec_id 2013-08-24 17:02:23 +02:00
John Stebbins
30ce289074 movenc: Make tkhd "enabled" flag QuickTime compatible
QuickTime will play multiple audio tracks concurrently if this flag is
set for multiple audio tracks.  And if no subtitle track has this flag
set, QuickTime will show no subtitles in the subtitle menu.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-08-23 09:55:42 +02:00
John Stebbins
1f70a5ad28 mov: use tkhd enabled flag to set the default track
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-08-23 09:24:22 +02:00
Clément Bœsch
60198742ff movenc: fix detection of 64bit offset requirement
The old method doesn't work when moov is relocated to beginning of file

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-21 14:20:33 +01:00
John Stebbins
fe5d5a8ffc movenc: Make chapter track QuickTime compatible
QuickTime requires that the stsd.text box be completely filled in.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-21 14:20:33 +01:00
Clément Bœsch
f8ef91ff3d movenc: add faststart option for web streaming
Faststart moves the moov atom to the beginning of the file and rewrites
the rest of the file after muxing is complete.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-21 14:20:33 +01:00
John Stebbins
6c786765cd movenc: Allow chapters to be written in trailer
This allows creation of frame accurate chapter marks from sources
like DVD and BD where the precise chapter location is not known until
the chapter mark has been reached during reading.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-20 15:18:42 +01:00
John Stebbins
db03cb37fd movenc: Allow chapter track in default MODE_MP4
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-20 15:18:42 +01:00
Diego Biurrun
64af59bc49 avformat: Fix references to removed av_close_input_file in Doxygen 2013-08-20 13:33:47 +02:00
Luca Barbato
67400f6b62 mov: Prevent segfaults on mov_write_hdlr_tag
Do not segfault when writing tracks such as tmcd by writing them down
as generic DataHandlers if not known.
2013-08-20 00:22:58 +02:00
Luca Barbato
22de0f8369 mov: Compute max duration among the tracks with a timescale
Prevent an assert.
2013-08-20 00:22:58 +02:00
Luca Barbato
3952303010 mov: Set the timescale for data streams
Data streams have a defined timebase, do not ignore it.
2013-08-20 00:22:58 +02:00
Martin Storsjö
b886f5c2f1 mkv: Allow flushing the current cluster in progress
Allow emitting the current cluster that is being written before
starting a new one, simplifying how to figure out where clusters
are positioned in the output stream (for live streaming).

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-19 22:47:07 +02:00
Luca Barbato
59f595921e mkv: Flush the old cluster before writing a new one
This simplifies keeping track of cluster boundaries for e.g.
livestreaming of WebM.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-19 22:47:06 +02:00
Luca Barbato
98308bd44f mkv: Add options for specifying cluster limits
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-19 22:46:31 +02:00
Luca Barbato
148fbdd1c2 mkv: Refactor mkv_write_packet
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-19 17:21:15 +02:00
Reimar Döffinger
9a27acae9e ogg: Fix potential infinite discard loop
Seeking in certain broken files would cause ogg_read_timestamp
to fail because ogg_packet would go into a state where all packets
of stream 1 would be discarded until the end of the stream.

Bug-Id: 553
CC: libav-stable@libav.org

Signed-off-by: Jan Gerber <j@v2v.cc>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-08-19 05:20:39 +02:00
Martin Storsjö
0a14fefd68 movenc: Indicate that negative timestamps are supported
The mov/mp4 muxer has support for handling negative timestamps
via edit lists (which customarily is used for handling the 1-frame
delay due to B-frames as well).

Using the muxer's native way of handling it is better than using
the generic offsetting. The generic offsetting is a bit too
crude when e.g. the timebase of one track is 1/fps, where the
edit lists can handle it accurately.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-17 22:46:11 +01:00
Carl Eugen Hoyos
9d86bfc259 hlsenc: Don't reset the number variable when wrapping
The counter itself shouldn't be wrapped, since it is used for
determining end_pts for the next segment - only wrap the number
used for the segment file name.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-15 22:41:19 +03:00
Stefano Sabatini
09c93b1b95 hlsenc: Append the last incomplete segment when closing the output
Also avoid comparing NOPTS values.

Bug-id: 551
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-15 22:41:18 +03:00
Martin Storsjö
c9031c7c14 hlsenc: Add a proper dependency on the mpegts muxer
The hls muxer itself doesn't have any direct (object file level)
dependencies on mpegtsenc.o, and including that object file
directly doesn't ensure that it is registered so that the muxer
actually is accessible.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-15 22:41:11 +03:00
Martin Storsjö
4b054a3400 rtpproto: Check the right feature detection macro
IPPROTO_IPV6 is unrelated here (it's only used in udp.c for
multicast sockopts), check for support for the sockaddr_in6
struct itself.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-15 15:35:41 +03:00
Diego Biurrun
163a729725 electronicarts: Let functions always returning the same value return void 2013-08-15 12:24:43 +02:00
Diego Biurrun
4908c8ef27 electronicarts: Improve some function/variable names 2013-08-15 12:24:42 +02:00
Diego Biurrun
a90cff137b electronicarts: comment wording fixes 2013-08-15 12:24:42 +02:00
Diego Biurrun
288f2ffb57 electronicarts: Remove bogus function documentation 2013-08-15 12:24:42 +02:00
Diego Biurrun
8747fce91f electronicarts: K&R formatting cosmetics 2013-08-15 12:24:42 +02:00
Dave Yeo
c3386bd5b4 rtpproto: Check for the right feature when reading a sockaddr_in6
Some systems, such as OS/2, define AF_INET6 without a full
implementation.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-15 10:31:43 +03:00
Martin Storsjö
b56fc18b20 sdp: Add an option for sending RTCP packets to the source of the last packets
An SDP description normally only contains the target IP address
and port for the packets. This means that we don't really have
any clue where to send the RTCP RR packets - previously they're
sent to the destination IP written in the SDP (at the same port),
which rarely is the actual peer. And if the source for the packets
is on a different port than the destination, it's never correct.

With a new option, we can choose to send the packets to the
address that the latest packet on each socket arrived from.
---
Some may even argue that this should be the default - perhaps,
but I'd rather keep it optional at first. Additionally, I'm not
sure if sending RTCP RR directly back to the source is
desireable for e.g. multicast.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-14 11:21:33 +03:00
Martin Storsjö
6b58e11a83 rtpproto: Add an option for writing return packets to the address of the last received packets
If we've received packets on the same socket before, the return
packets are sent to that address. If we've only received packets
on the other socket, try to guess the source port for the other
one assuming the basic +1/-1 logic.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-14 11:21:32 +03:00
Martin Storsjö
2427ac6ccd rtpproto: Update the parameter documentation
Move the sources documentation up below the marker for deprecated
otpions. Also mention the new block parameter, that was added
in 749722209.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-13 22:16:53 +03:00
Luca Barbato
5268bd2900 segafilm: Error out on impossible packet size
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-08-13 15:14:07 +02:00
Luca Barbato
3562684db7 ogg: Always alloc the private context in vorbis_header
It is possible to have an initial broken header and then valid packets.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2013-08-13 14:04:55 +02:00
Luca Barbato
5718e3487b rtmp: Do not misuse memcmp
CC: libav-stable@libav.org
2013-08-11 01:19:27 +02:00
Martin Storsjö
8e1fe34557 rtmp: Detect and warn if the user tries to pass librtmp style parameters
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-10 18:37:18 +03:00
Luca Barbato
ba5393a609 rtmp: rename data_size to size 2013-08-10 13:49:09 +02:00
Luca Barbato
4ebc7d659f rtmp: Use PRId64 when needed. 2013-08-10 13:48:48 +02:00
Martin Storsjö
e743e7ae6e libavutil: Make avpriv_open a library-internal function on msvcrt
Add one copy of the function into each of the libraries, similarly
to what we do for log2_tab. When using static libs, only one
copy of the file_open.o object file gets included, while when
using shared libraries, each of them get a copy of its own.

This fixes DLL builds with a statically linked C runtime, where
each DLL effectively has got its own instance of the C runtime,
where file descriptors can't be shared across runtimes.

On systems not using msvcrt, the function is not duplicated.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-10 00:53:33 +03:00
Rémi Denis-Courmont
9d5ec50ead ff_socket: put out-of-line and fallback to fcntl() for close-on-exec
This supports non-Linux systems (SOCK_CLOEXEC is non-standard) and
older Linux kernels to the extent possible.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-09 11:26:50 +03:00
Martin Storsjö
dfc6b5c814 file: Move win32 utf8->wchar open wrapper to libavutil
When libavformat was changed to use the new avpriv_open function
in 51eb213d00, this silently bypassed the existing wrapper for
win32. Move the win32 wrapper into libavutil/file.c to make sure
it gets called everywhere (not just in the libavformat case).

This makes sure that non-ascii file names gets opened properly
(where file names internally are stored as utf8, but they get
converted to wchar_t and opened with _wsopen).

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-08 16:41:33 +03:00
Ben Avison
5afe1d2791 avio: Add const qualifiers to ffio_read_indirect
This provides at least some protection against potential accidental
corruption of AVIO buffer workspace.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-08 11:09:00 +03:00
Rémi Denis-Courmont
51eb213d00 libavformat: use avpriv_open()
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-08-07 21:22:03 +02:00
Martin Storsjö
f4d371b973 rtsp: Don't include the listen flag in the SDP demuxer flags
It's only relevant for the RTSP demuxer. Similarly, the custom_io
flag is only present in the SDP demuxer options list.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-07 13:16:44 +03:00
Kostya Shishkov
f544c58636 deprecate AV_CODEC_ID_VOXWARE and introduce AV_CODEC_ID_METASOUND instead
Voxware is the name of company, it has produced several audio codecs e.g.
MetaVoice family and MetaSound.
2013-08-07 10:56:18 +02:00
Martin Storsjö
62572435d4 rtpenc_chain: Check for errors from ffio_fdopen and ffio_open_dyn_packet_buf
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-07 11:37:13 +03:00
Martin Storsjö
f542dedf72 rtspenc: Check the return value from ffio_open_dyn_packet_buf
Also clear the AVIOContext handle after freeing, to avoid
possible dangling pointers if the later call fails.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-07 11:37:01 +03:00
Diego Biurrun
255d9c570e riff: Move demuxing code to a separate file. 2013-08-06 11:02:36 +02:00
Diego Biurrun
3dd5c95dee riff: Move muxing code to a separate file 2013-08-06 11:02:35 +02:00
Diego Biurrun
fcc455ff2e avformat/dv: K&R formatting cosmetics 2013-08-06 11:01:44 +02:00
Martin Storsjö
abe5268c33 tcp: Use a different log message and level if there's more addresses to try
This lowers the level of warnings printed if trying to connect
to a host name that provides both v6 and v4 addresses but the
service only is available on the v4 address (often occurring for
'localhost', with servers that aren't v6-aware).

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-06 10:39:39 +03:00
Martin Storsjö
2a0ec47bd7 unix: Convert from AVERROR to errno range before comparing error codes
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-06 10:38:14 +03:00
Diego Biurrun
971cce7ebb riff.h: Remove stray extern declaration for non-existing symbol 2013-08-05 22:44:48 +02:00
Ben Avison
a22ae9f0c5 mpegts: Remove one 64-bit integer modulus operation per packet
The common case of the pointer having increased by one packet (which results
in no change to the modulus) can be detected with a 64-bit subtraction,
which is far cheaper than a division on many platforms.

           Before          After
           Mean   StdDev   Mean   StdDev  Change
Divisions   248.3  8.8      51.5   7.4    +381.7%
Overall    2773.2 25.6     2372.5 43.1     +16.9%

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-05 19:25:55 +03:00
Luca Barbato
bb9378251a network: Use SOCK_CLOEXEC when available 2013-08-05 16:13:36 +02:00
Luca Barbato
605387582b lavf: Support unix sockets 2013-08-05 16:13:35 +02:00
Ben Avison
c84ea750cf mpegts: Make discard_pid() faster for single-program streams
When a stream contains a single program, there's no point in doing a
PID -> program lookup. Normally the one and only program isn't disabled,
so no packets should be discarded.

              Before          After
              Mean   StdDev   Mean   StdDev  Change
discard_pid()   73.8  9.4       20.2  1.5    +264.8%
Overall       2300.8 28.0     2253.1 20.6      +2.1%

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-05 15:18:42 +03:00
Ben Avison
cabb168169 mpegts: Remove one memcpy per packet
This was being performed to ensure that a complete packet was held in
contiguous memory, prior to parsing the packet. However, the source buffer
is typically large enough that the packet was already contiguous, so it is
beneficial to return the packet by reference in most cases.

         Before          After
         Mean   StdDev   Mean   StdDev  Change
memcpy    720.7  32.7     649.8  25.1   +10.9%
Overall  2372.7  46.1    2291.7  21.8    +3.5%

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-05 15:14:31 +03:00
Ben Avison
daf1e0d3de avio: Add an internal function for reading without copying
As long as there is enough contiguous data in the avio buffer,
just return a pointer to it instead of copying it to the caller
provided buffer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-05 15:14:25 +03:00
Diego Biurrun
22a154e436 build: Add missing img2.o dependency to apetag.o 2013-08-05 11:38:00 +02:00
Alexandra Khirnova
7684a36113 mxfenc: switch to av_reallocp_array() and check allocation errors
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-08-04 16:49:04 +02:00
Diego Biurrun
7950e519bb Disable deprecation warnings for cases where a replacement is available 2013-08-02 19:19:02 +02:00
Diego Biurrun
b5a138652f Give less generic names to global library option arrays 2013-08-02 19:19:02 +02:00
Gavriloaie Eugen-Andrei
0d6fa3977b rtmp: Add seek support
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-02 20:11:54 +03:00
Diego Biurrun
f900f35ac8 flvdec: Eliminate completely silly goto 2013-08-01 12:43:54 +02:00
Diego Biurrun
e4529df944 flvdec: K&R formatting cosmetics 2013-08-01 12:43:53 +02:00
Diego Biurrun
390b4d7088 flvdec: Fix = vs. == typo in sample rate check 2013-08-01 12:43:53 +02:00
Martin Storsjö
fd8f91e3f4 rtsp: Simplify code for forming the remote peer url
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-01 12:11:17 +03:00
Martin Storsjö
ee37d5811c rtpproto: Allow specifying a separate rtcp port in ff_rtp_set_remote_url
A separate rtcp port can already be set when opening the rtp
protocol normally, but when doing port setup as in RTSP (where
we first need to open the local ports and pass them to the peer,
and only then receive the remote peer port numbers), we didn't
check the same url parameter as in the normal open routine.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-01 10:26:17 +03:00
Martin Storsjö
1851e1d05d rtpproto: Check the size before reading buf[1]
I doubt that anyone ever would try to send a 1 byte packet
via the RTP protocol, but check just in case - it shouldn't
crash at least.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-01 09:41:21 +03:00
Martin Storsjö
b7e6da988b rtpproto: Move rtpproto specific function declarations to a separate header
Mixing these with the rtp depacketizer functions in rtpdec.h is
no good.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-31 21:12:34 +03:00
Martin Storsjö
892b0be1df rtpproto: Simplify the rtp_read function by looping over the fds
This avoids having duplicate code where only the fd parameter
differs.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-31 21:12:34 +03:00