changeset 5109:293c03f0d47f libavformat

Add handling of EAGAIN at packet boundaries. See "[PATCH] RTSP-MS 14/15: ASF packet parsing" thread for discussion / reasoning.
author rbultje
date Sun, 26 Jul 2009 19:09:35 +0000
parents 44a0fab134a9
children 147adb327b84
files asfdec.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/asfdec.c	Sun Jul 26 12:20:04 2009 +0000
+++ b/asfdec.c	Sun Jul 26 19:09:35 2009 +0000
@@ -609,6 +609,14 @@
     }
 
     if (c != 0x82) {
+        /**
+         * This code allows handling of -EAGAIN at packet boundaries (i.e.
+         * if the packet sync code above triggers -EAGAIN). This does not
+         * imply complete -EAGAIN handling support at random positions in
+         * the stream.
+         */
+        if (url_ferror(pb) == AVERROR(EAGAIN))
+            return AVERROR(EAGAIN);
         if (!url_feof(pb))
             av_log(s, AV_LOG_ERROR, "ff asf bad header %x  at:%"PRId64"\n", c, url_ftell(pb));
     }