[rtmpdump] r359 - trunk/librtmp/rtmp.c

hyc subversion at mplayerhq.hu
Tue Mar 16 06:37:15 CET 2010


Author: hyc
Date: Tue Mar 16 06:37:14 2010
New Revision: 359

Log:
More for RTMP_Write

Modified:
   trunk/librtmp/rtmp.c

Modified: trunk/librtmp/rtmp.c
==============================================================================
--- trunk/librtmp/rtmp.c	Tue Mar 16 05:57:10 2010	(r358)
+++ trunk/librtmp/rtmp.c	Tue Mar 16 06:37:14 2010	(r359)
@@ -3599,6 +3599,7 @@ RTMP_Write(RTMP *r, char *buf, int size)
       memcpy(enc, buf, num);
       pkt->m_nBytesRead += num;
       s2 -= num;
+      buf += num;
       if (pkt->m_nBytesRead == pkt->m_nBodySize)
 	{
 	  ret = RTMP_SendPacket(r, pkt, false);
@@ -3608,7 +3609,9 @@ RTMP_Write(RTMP *r, char *buf, int size)
 	    return -1;
 	  buf += 4;
 	  s2 -= 4;
+	  if (s2 < 0)
+	    break;
 	}
     }
-  return size;
+  return size+s2;
 }


More information about the rtmpdump mailing list