[rtmpdump] r256 - trunk/rtmpdump.c

hyc subversion at mplayerhq.hu
Sun Feb 21 03:16:21 CET 2010


Author: hyc
Date: Sun Feb 21 03:16:19 2010
New Revision: 256

Log:
Log a final status update when stopping

Modified:
   trunk/rtmpdump.c

Modified: trunk/rtmpdump.c
==============================================================================
--- trunk/rtmpdump.c	Sat Feb 20 03:37:51 2010	(r255)
+++ trunk/rtmpdump.c	Sun Feb 21 03:16:19 2010	(r256)
@@ -1019,6 +1019,24 @@ Download(RTMP * rtmp,		// connected RTMP
   while (!RTMP_ctrlC && nRead > -1 && RTMP_IsConnected(rtmp));
   free(buffer);
 
+  /* Final status update */
+  if (!bHashes)
+    {
+      if (duration > 0)
+	{
+	  *percent = ((double) timestamp) / (duration * 1000.0) * 100.0;
+	  *percent = ((double) (int) (*percent * 10.0)) / 10.0;
+	  LogStatus("\r%.3f kB / %.2f sec (%.1f%%)",
+	    (double) size / 1024.0,
+	    (double) (timestamp) / 1000.0, *percent);
+	}
+      else
+	{
+	  LogStatus("\r%.3f kB / %.2f sec", (double) size / 1024.0,
+	    (double) (timestamp) / 1000.0);
+	}
+    }
+
   Log(LOGDEBUG, "WriteStream returned: %d", nRead);
 
   if (bResume && nRead == -2)


More information about the rtmpdump mailing list