]> granicus.if.org Git - rtmpdump/commitdiff
Log a final status update when stopping
authorhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sun, 21 Feb 2010 02:16:19 +0000 (02:16 +0000)
committerhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sun, 21 Feb 2010 02:16:19 +0000 (02:16 +0000)
git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@256 400ebc74-4327-4243-bc38-086b20814532

rtmpdump.c

index 1e89b68df9247ee5fe816847c9f19b5027547e6b..94fb8193d2b9436aaf75bb63d2736e739b343ef6 100644 (file)
@@ -1019,6 +1019,24 @@ Download(RTMP * rtmp,            // connected RTMP object
   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)