[FFmpeg-devel] [RFC] unix socket protocol and our proto situation

Luca Barbato lu_zero
Wed Dec 15 18:28:45 CET 2010

On 12/15/2010 04:03 PM, aviad rozenhek wrote:
> On Wed, Dec 15, 2010 at 16:35, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>> Hi,
>> On Wed, Dec 15, 2010 at 6:31 AM, aviad rozenhek <aviadr1 at gmail.com> wrote:
>>> The 64k socket buffer asked for by ffmpeg is too small, especially when
>>> using higher bitrate streams like 10mbps and up.
>>> using 250k is much more reasonable IMHO and works much better.
>>> using a tight loop to read from the socket improves on the current
>>> situation, but does not fix it.
>>> increasing the buffer size solves it completely, and requires no code.
>> I think this is fine, but if you change default, please document that
>> properly in changelog and try making it settable, if possible, with a
>> AVOption in the RTSPDemuxer. That way apps that want smaller buffers
>> don't have to waste memory.
>> Ronald
> I don't have commit access,
> I was hoping that someone with commit access would be able to change the
> default buffer size in udp.c


diff --git a/libavformat/udp.c b/libavformat/udp.c
index b998086..eb7cf14 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -54,7 +54,7 @@ typedef struct {
 } UDPContext;

 #define UDP_TX_BUF_SIZE 32768
-#define UDP_MAX_PKT_SIZE 65536
+#define UDP_MAX_PKT_SIZE 262144

 static int udp_set_multicast_ttl(int sockfd, int mcastTTL,
                                  struct sockaddr *addr)

I'm still not convinced that this alone helps, but shouldn't hurt that much.



Luca Barbato

More information about the ffmpeg-devel mailing list