Skip to content

Instantly share code, notes, and snippets.

@rdp
Created February 18, 2014 17:29
Show Gist options
  • Save rdp/9075572 to your computer and use it in GitHub Desktop.
Save rdp/9075572 to your computer and use it in GitHub Desktop.
diff --git a/libavformat/udp.c b/libavformat/udp.c
index a61ac33..c982245 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -784,10 +784,11 @@ static int udp_read(URLContext *h, uint8_t *buf, int size)
av_fifo_generic_read(s->fifo, tmp, 4, NULL);
avail= AV_RL32(tmp);
if(avail > size){
- av_log(h, AV_LOG_WARNING, "Part of datagram lost due to insufficient buffer size\n");
- avail= size;
+ av_log(h, AV_LOG_WARNING, "requested too small of datagram\n"); // comment this out if too chatty
+ //avail= size;
+ return -10040; // windows equiv. of "out of space" or something, any negative number here will do. Really what we're doing here is telling mplayer "ok, you've reached the bottom of your cache, give up now!" work around...
}
-
+
av_fifo_generic_read(s->fifo, buf, avail, NULL);
av_fifo_drain(s->fifo, AV_RL32(tmp) - avail);
pthread_mutex_unlock(&s->mutex);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment