[rtmpdump] r471 - in trunk: librtmp/rtmp.c librtmp/rtmp.h rtmpdump.c

hyc subversion at mplayerhq.hu
Wed May 5 07:47:19 CEST 2010


Author: hyc
Date: Wed May  5 07:47:18 2010
New Revision: 471

Log:
Don't use the BufferEmpty toggle trick by default in librtmp,
but set it by default in rtmpdump

Modified:
   trunk/librtmp/rtmp.c
   trunk/librtmp/rtmp.h
   trunk/rtmpdump.c

Modified: trunk/librtmp/rtmp.c
==============================================================================
--- trunk/librtmp/rtmp.c	Tue May  4 23:09:42 2010	(r470)
+++ trunk/librtmp/rtmp.c	Wed May  5 07:47:18 2010	(r471)
@@ -2595,7 +2595,7 @@ HandleCtrl(RTMP *r, const RTMPPacket *pa
 	case 31:
 	  tmp = AMF_DecodeInt32(packet->m_body + 2);
 	  RTMP_Log(RTMP_LOGDEBUG, "%s, Stream BufferEmpty %d", __FUNCTION__, tmp);
-	  if ((r->Link.lFlags & RTMP_LF_LIVE) || (r->Link.protocol & RTMP_FEATURE_HTTP))
+	  if (!(r->Link.lFlags & RTMP_LF_BUFX))
 	    break;
 	  if (!r->m_pausing)
 	    {

Modified: trunk/librtmp/rtmp.h
==============================================================================
--- trunk/librtmp/rtmp.h	Tue May  4 23:09:42 2010	(r470)
+++ trunk/librtmp/rtmp.h	Wed May  5 07:47:18 2010	(r471)
@@ -141,10 +141,11 @@ extern "C"
     int seekTime;
     int stopTime;
 
-#define RTMP_LF_AUTH	0x0001
-#define RTMP_LF_LIVE	0x0002
-#define RTMP_LF_SWFV	0x0004
-#define RTMP_LF_PLST	0x0008
+#define RTMP_LF_AUTH	0x0001	/* using auth param */
+#define RTMP_LF_LIVE	0x0002	/* stream is live */
+#define RTMP_LF_SWFV	0x0004	/* do SWF verification */
+#define RTMP_LF_PLST	0x0008	/* send playlist before play */
+#define RTMP_LF_BUFX	0x0010	/* toggle stream on BufferEmpty msg */
     int lFlags;
 
     int swfAge;

Modified: trunk/rtmpdump.c
==============================================================================
--- trunk/rtmpdump.c	Tue May  4 23:09:42 2010	(r470)
+++ trunk/rtmpdump.c	Wed May  5 07:47:18 2010	(r471)
@@ -1168,6 +1168,10 @@ main(int argc, char **argv)
 		   &tcUrl, &swfUrl, &pageUrl, &app, &auth, &swfHash, swfSize,
 		   &flashVer, &subscribepath, dSeek, dStopOffset, bLiveStream, timeout);
 
+  /* Try to keep the stream moving if it pauses on us */
+  if (!bLiveStream && !(protocol & RTMP_FEATURE_HTTP))
+    rtmp.Link.lFlags |= RTMP_LF_BUFX;
+
   off_t size = 0;
 
   // ok, we have to get the timestamp of the last keyframe (only keyframes are seekable) / last audio frame (audio only streams)


More information about the rtmpdump mailing list