Skip to content

Instantly share code, notes, and snippets.

@rdp
Created January 15, 2014 19:52
Show Gist options
  • Save rdp/8443238 to your computer and use it in GitHub Desktop.
Save rdp/8443238 to your computer and use it in GitHub Desktop.
int a;
getsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &a, &len);
printf("started as %d, setting it as %d\n", a, tmp );
if (setsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, sizeof(tmp)) < 0) {
log_net_error(h, AV_LOG_WARNING, "setsockopt(SO_RECVBUF)");
}
len = sizeof(tmp);
if (getsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, &len) < 0) {
log_net_error(h, AV_LOG_WARNING, "getsockopt(SO_RCVBUF)");
} else
av_log(h, AV_LOG_DEBUG, "end receive buffer size reported is %d\n", tmp);
...an input file: udp://227.0.0.1?buffer_size=2222.
started as 212992, setting it as 2222
[udp @ 0x1a72ec0] end receive buffer size reported is 4444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment