[FFmpeg-soc] [soc]: r4771 - rtmp/rtmpproto.c

kostya subversion at mplayerhq.hu
Wed Jul 22 09:23:43 CEST 2009


Author: kostya
Date: Wed Jul 22 09:23:43 2009
New Revision: 4771

Log:
If there's not any data yet, don't sleep, report it to the library

Modified:
   rtmp/rtmpproto.c

Modified: rtmp/rtmpproto.c
==============================================================================
--- rtmp/rtmpproto.c	Wed Jul 22 09:15:24 2009	(r4770)
+++ rtmp/rtmpproto.c	Wed Jul 22 09:23:43 2009	(r4771)
@@ -26,7 +26,6 @@
 
 #include <unistd.h>
 #include <stdarg.h>
-#include <sys/time.h>
 
 #include "libavcodec/bytestream.h"
 #include "libavutil/avstring.h"
@@ -459,20 +458,15 @@ static int rtmp_parse_result(URLContext 
 static int get_packet(URLContext *s, int for_header)
 {
     RTMPContext *rt = s->priv_data;
-    struct timespec ts;
     int ret;
 
-    ts.tv_sec = 0;
-    ts.tv_nsec = 500000000;
-
     for(;;) {
         RTMPPacket rpkt;
         int has_data = 0;
         if ((ret = ff_rtmp_packet_read(rt->stream, &rpkt,
                                        rt->chunk_size, rt->prev_pkt[0])) != 0) {
             if (ret > 0) {
-                nanosleep(&ts, NULL);
-                continue;
+                return AVERROR(EAGAIN);
             } else {
                 return AVERROR(EIO);
             }


More information about the FFmpeg-soc mailing list