Commit Graph

9362 Commits

Author SHA1 Message Date
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
Martin Storsjö 7531588fff rtpproto: Remove a misplaced comment
The fdset is a pollfd array nowadays, and it is already populated
at this point.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-31 21:12:34 +03:00
Martin Storsjö 54e03ff6af rtpproto: Support nonblocking reads
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-31 21:12:34 +03:00