[FFmpeg-devel] libavformat/tcp.c : add send_buffer_size and recv_buffer_size options

Perette Barella perette at barella.org
Fri Jan 15 22:40:38 CET 2016

Attached is a patch to libavformat/tcp.c for your consideration.  It 
adds two new options that may be set via the dictionary:

- send_buffer_size
- recv_buffer_size

When present, setsockopt() is used with SO_SNDBUF and SO_RCVBUF to set 
socket buffer sizes.  I chose to make send and receive independent 
because buffering requirements are often asymmetric.

Errors in setting the buffer size mean the socket will use its 
default, so they are ignored.

There is no sanity checking on values, as the kernel/socket layers 
already impose reasonable limits if asked for something crazy.

Rationale for enlarging receive buffers is to reduce susceptibility 
to intermittent network delays/congestion.  I added setting the send 
buffer for symmetry.

Changes to other lines in the options table were just to align the
columns neatly.

In case the mailing list strips or mangles attachments, the patch
is also at: http://deviousfish.com/Downloads/tcp_c_buffer_size.patch

Thank you.

Perette Barella • perette at barella.org • 585-286-1312
176 Middlesex Road, Rochester NY 14610

More information about the ffmpeg-devel mailing list