Suggested by zhilizhao, vlc project has solved the compatibility by
the same way, so I borrowed the comments from vlc project.
Fixes ticket #9449
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Zhao Zhili added a ttl upper bound in commit 9daac85da8,
but the check for ttl in url is missing still.
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
POSIX errno is positive. We have strict_pthread_cond_wait to handle
error code during development.
Signed-off-by: zhilizhao <zhilizhao@tencent.com>
Reviewed-by: Jun Zhao <barryjzhao@tencent.com>
15d160cc0b increased the UDP socket receiving buffer size
(64K ->384K), but missed to update this comments.
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
recvfrom() is not a cancellation point in pthreads-win32, see
https://sourceware.org/pthreads-win32/manual/pthread_cancel.html
In order to be able to cancel the reader thread on Win32 properly we first
shutdown the socket then call CancelIoEx to abort pending IO. Subsequent
recvfrom() calls will fail with WSAESHUTDOWN causing the thread to exit.
Fixes ticket #5717.
Signed-off-by: Marton Balint <cus@passwd.hu>
It is a common mistake that people only increase fifo_size when they experience
drops, unfortunately this does not help for higher bitrate (> 100 Mbps) streams
when the reader thread simply might not receive the packets in time (especially
under high CPU load) if the default 64 KB of kernel buffer size is used.
New default is determined so that common linux systems can set this buffer size
without tuning kernel parameters.
Signed-off-by: Marton Balint <cus@passwd.hu>
That alone supports specifying the interface based on its address. Getting the
interface index from the local address seems quite a bit of work in a platform
independent way...
Obviously for IPv6 we still always use MCAST_JOIN_SOURCE_GROUP.
As a side effect this also fixes ticket #7459.
Signed-off-by: Marton Balint <cus@passwd.hu>
We already use localaddr for the multicast joins without source filters, so we
should use them for source filters as well. This patch only fixes the
IP_ADD_SOURCE_MEMBERSHIP and the IP_BLOCK_SOURCE case.
Unless we do this, the kernel automatically selects an interface based on the
source address, and that interface might be different from the one set in
localaddr. For blocked sources this even casues EINVAL because we joined the
multicast group on a different interface.
Signed-off-by: Marton Balint <cus@passwd.hu>
This allows getting data only from a specific source IP. This is useful not
only for unicast but for multicast as well because multicast source
subscriptions do not act as source filters for the incoming packets.
Signed-off-by: Marton Balint <cus@passwd.hu>
glibc introduced _DEFAULT_SOURCE in version 2.19 to replace _BSD_SOURCE and
_SVID_SOURCE, which were deprecated in version 2.20. Add _DEFAULT_SOURCE
where the latter two are used to be forwards-compatible and avoid warnings
about the use of deprecated definitions.
We haven't had a stable release since the packet_gap addition, so probably it
is worth reworking the option to something that makes more sense to the end
user. Also add burst_bits option to specify maximum length of bit bursts.
Signed-off-by: Marton Balint <cus@passwd.hu>
Since d607861, service can not be NULL, only "0".
An UDP address with neither local port nor address leaves both
service and node to their default value, and POSIX specifies
that they are not allowed to be both NULL; "0" is equivalent
to an unspecified port for all currently known protocols.
Fix CID 1341570.
This fixes partially completed send()
Avoids holding the mutex during send()
fixes race conditions in error handling
removes copied non thread specific blocking code
Fixes deadlocks on closure
Fixes data loss on closure
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit enables sending UDP packets in a background thread with specified delay.
When sending packets without a delay some devices with small RX buffer
( MAG200 STB, for example) will drop tail packets in bursts causing
decoding errors.
To use it specify "fifo_size" with "packet_gap" .
The output url will looks like udp://xxx:yyy?fifo_size=<output fifo
size>&packet_gap=<delay in usecs>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Instead of a linked list constructed at av_register_all(), store them
in a constant array of pointers.
Since no registration is necessary now, this removes some global state
from lavf. This will also allow the urlprotocol layer caller to limit
the available protocols in a simple and flexible way in the following
commits.
Glibc 2.20 onwards generates a deprecation warning for usage of _BSD_SOURCE and _SVID_SOURCE.
The solution from man feature_test_macros is to define both _DEFAULT_SOURCE and the old macros.
This solution is on the lines of the one in commit af1818276e.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>