[vlc-commits] udp: improve out-of-memory handling
Rémi Denis-Courmont
git at videolan.org
Fri Jun 5 22:28:37 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Jun 5 23:27:43 2015 +0300| [ce3bd683fe3ff714a7585cc2f2e81c04a2ccfb94] | committer: Rémi Denis-Courmont
udp: improve out-of-memory handling
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ce3bd683fe3ff714a7585cc2f2e81c04a2ccfb94
---
modules/access/udp.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules/access/udp.c b/modules/access/udp.c
index d7d911b..7472bf8 100644
--- a/modules/access/udp.c
+++ b/modules/access/udp.c
@@ -262,7 +262,11 @@ static void* ThreadRead( void *data )
{
block_t *pkt = block_Alloc(MTU);
if (unlikely(pkt == NULL))
- break;
+ { /* OOM - dequeue and discard one packet */
+ char dummy;
+ net_Read(access, sys->fd, &dummy, 1, false);
+ continue;
+ }
ssize_t len;
More information about the vlc-commits
mailing list