From 7ced770c341ef2d44c1627706bafeb7967478f3d Mon Sep 17 00:00:00 2001 From: hyc Date: Sun, 21 Feb 2010 02:16:19 +0000 Subject: [PATCH] Log a final status update when stopping git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@256 400ebc74-4327-4243-bc38-086b20814532 --- rtmpdump.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rtmpdump.c b/rtmpdump.c index 1e89b68..94fb819 100644 --- a/rtmpdump.c +++ b/rtmpdump.c @@ -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) -- 2.50.1