]> granicus.if.org Git - rtmpdump/commitdiff
Version updates
authorhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sat, 31 Oct 2009 02:25:22 +0000 (02:25 +0000)
committerhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Sat, 31 Oct 2009 02:25:22 +0000 (02:25 +0000)
git-svn-id: svn://svn.mplayerhq.hu/rtmpdump@16 400ebc74-4327-4243-bc38-086b20814532

16 files changed:
README
bytes.c
dh.c
dh.h
handshake.cpp
log.c
log.h
more-than-64-channels.patch [deleted file]
parseurl.c
parseurl.h
rtmp.cpp
rtmp.h
rtmpdump.cpp
rtmppacket.cpp
rtmppacket.h
streams.cpp

diff --git a/README b/README
index 5bbca8117dbf838e7e28d44cb2fcca2a2f8f6961..a12b239f7fa71e21bba4a8f26dba71b5b4d9dfdd 100644 (file)
--- a/README
+++ b/README
@@ -1,5 +1,6 @@
-RTMP Dump v1.6
+RTMP Dump v1.7
 (C) 2009 Andrej Stepanchuk
+(C) 2009 Howard Chu
 License: GPLv2
 
 To compile just type
diff --git a/bytes.c b/bytes.c
index 5b7300d7c5cee74607627e00bf59ee2db5dd41d2..1080aac733a9843b07bfa39c7b64296d8046904e 100644 (file)
--- a/bytes.c
+++ b/bytes.c
@@ -1,5 +1,6 @@
 /*  RTMPDump
  *  Copyright (C) 2008-2009 Andrej Stepanchuk
+ *  Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
diff --git a/dh.c b/dh.c
index 277c48b65848874c95042b64738c1d6a53266359..336e63b8d6c20b98ddd18cfae82cf4329bff4a36 100644 (file)
--- a/dh.c
+++ b/dh.c
@@ -1,5 +1,6 @@
 /*  RTMPDump - Diffie-Hellmann Key Exchange
  *  Copyright (C) 2009 Andrej Stepanchuk
+ *  Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
diff --git a/dh.h b/dh.h
index 92df8cf55a7e2c9bab8deb398871b9b98afc04fe..d6649dc2cd7daa180f30e89fb2638719e13e43ea 100644 (file)
--- a/dh.h
+++ b/dh.h
@@ -1,5 +1,6 @@
 /*  RTMPDump - Diffie-Hellmann Key Exchange
  *  Copyright (C) 2009 Andrej Stepanchuk
+ *  Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
index 863530c8aef25405027cdc17a612f8b6351520ae..8d53eaeca260079d9048bb915c583b735a5d440a 100644 (file)
@@ -1,5 +1,6 @@
 /*
  *  Copyright (C) 2008-2009 Andrej Stepanchuk
+ *  Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
diff --git a/log.c b/log.c
index 0ca993eb05687d3c5f7135f294a15b387967c4fc..7a07e7b14b9e8b1ac2142e74e508ff86a3130681 100644 (file)
--- a/log.c
+++ b/log.c
@@ -1,5 +1,6 @@
 /*  RTMPDump
  *  Copyright (C) 2008-2009 Andrej Stepanchuk
+ *  Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -28,6 +29,8 @@
 
 extern int debuglevel;
 
+static int neednl;
+
 FILE *fmsg;
 
 void LogSetOutput(FILE *file)
@@ -48,12 +51,37 @@ void LogPrintf(const char *format, ...)
 
        if ( !fmsg ) fmsg = stderr;
 
+       if (neednl) {
+               putc('\n', fmsg);
+               neednl = 0;
+       }
+
        fprintf(fmsg, "%s", str);
 #ifdef _DEBUG
        fflush(fmsg);
 #endif
 }
 
+void LogStatus(const char *format, ...)
+{
+       char str[MAX_PRINT_LEN]="";
+       va_list args;
+       va_start(args, format);
+       vsnprintf(str, MAX_PRINT_LEN-1, format, args);
+       va_end(args);
+
+       if ( debuglevel==LOGCRIT )
+               return;
+
+       if ( !fmsg ) fmsg = stderr;
+
+       fprintf(fmsg, "%s", str);
+#ifdef _DEBUG
+       fflush(fmsg);
+#endif
+       neednl = 1;
+}
+
 void Log(int level, const char *format, ...)
 {
        char str[MAX_PRINT_LEN]="";
@@ -68,13 +96,18 @@ void Log(int level, const char *format, ...)
 
        if ( !fmsg ) fmsg = stderr;
 
-       if ( level <= debuglevel )
+       if ( level <= debuglevel ) {
+               if (neednl) {
+                       putc('\n', fmsg);
+                       neednl = 0;
+               }
                fprintf(fmsg, "\r%s: %s\n", level==LOGDEBUG?"DEBUG":(level==LOGERROR?
 "ERROR":(level==LOGWARNING?"WARNING":(level==LOGCRIT?"CRIT":"INFO"))), str);
 
 #ifdef _DEBUG
-       fflush(fmsg);
+               fflush(fmsg);
 #endif
+       }
 }
 
 void LogHex(int level, const char *data, unsigned long len)
diff --git a/log.h b/log.h
index f706d1f1b35f3821eac2d60a855d6e7414c31dbf..85eb1bf34def8e6d134e412a927c410c6c0d60d4 100644 (file)
--- a/log.h
+++ b/log.h
@@ -1,5 +1,6 @@
 /*  RTMP Dump
  *  Copyright (C) 2008-2009 Andrej Stepanchuk
+ *  Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -43,6 +44,7 @@ extern "C" {
 
 void LogSetOutput(FILE *file);
 void LogPrintf(const char *format, ...);
+void LogStatus(const char *format, ...);
 void Log(int level, const char *format, ...);
 void LogHex(int level, const char *data, unsigned long len);
 void LogHexString(const char *data, unsigned long len);
diff --git a/more-than-64-channels.patch b/more-than-64-channels.patch
deleted file mode 100644 (file)
index 0f39c7f..0000000
+++ /dev/null
@@ -1,378 +0,0 @@
-Index: AMFObject.h\r
-===================================================================\r
---- AMFObject.h        (revision 4)\r
-+++ AMFObject.h        (working copy)\r
-@@ -24,6 +24,7 @@\r
- #include <string>
- #include <vector>
-+#include <stdint.h>
- namespace RTMP_LIB
- {
-Index: rtmpdump.cpp\r
-===================================================================\r
---- rtmpdump.cpp       (revision 6)\r
-+++ rtmpdump.cpp       (working copy)\r
-@@ -70,7 +70,11 @@\r
- FILE *netstackdump = 0;
- FILE *netstackdump_read = 0;
-+#ifdef CRYPTO
-+FILE *netstackdump_dec = 0;
-+FILE *netstackdump_read_dec = 0;
- #endif
-+#endif
- uint32_t nIgnoredFlvFrameCounter = 0;
- uint32_t nIgnoredFrameCounter = 0;
-@@ -142,8 +146,31 @@\r
-                       Log(LOGWARNING, "ignoring too small audio packet: size: %d", nPacketLen);
-                       return 0;
-               }
-+                if(packet.m_packetType == 0x12) { // && (nPacketLen == 24 || nPacketLen == 44)) {
-+                        //packet.Dump();
-+                        //LogHex(packetBody, nPacketLen);
-+                        RTMP_LIB::AMFObject obj;
-+                        /*int nRes =*/ obj.Decode(packetBody, nPacketLen);
-+                        std::string method = obj.GetProperty(0).GetString();
-+                        if (method == "onStatus")
-+                        {
-+                            Log(LOGWARNING, "ignoring onStatus(%s) packet", obj.GetProperty(1).GetObject().GetProperty("code").GetString().c_str());
-+                            return 0;
-+                        }
-+                        else if (method == "|RtmpSampleAccess")
-+                        {
-+                            Log(LOGWARNING, "ignoring |RtmpSampleAccess packet");
-+                            return 0;
-+                        }
-+                        /*if (strncmp(packetBody+2, "onStatus", 8) == 0)
-+                        {
-+                            Log(LOGDEBUG, "SKIP IT SKIP IT SKIP IT!!!!!!");
-+                        }*/
-+                        //Log(LOGWARNING, "pkt to SKIP: size: %d", nPacketLen);
-+                        //return 0;
-+                }
- #ifdef _DEBUG
--              Log(LOGDEBUG, "type: %02X, size: %d, TS: %d ms, abs TS: %d", packet.m_packetType, nPacketLen, packet.m_nTimeStamp, packet.m_hasAbsTimestamp);
-+              Log(LOGDEBUG, "type: %02X, ch: %d, size: %d, TS: %d ms, abs TS: %d", packet.m_packetType, packet.m_nChannel, nPacketLen, packet.m_nTimeStamp, packet.m_hasAbsTimestamp);
-               if(packet.m_packetType == 0x09)
-                       Log(LOGDEBUG, "frametype: %02X", (*packetBody & 0xf0));
- #endif
-@@ -980,7 +1007,11 @@\r
-       #ifdef _DEBUG
-       netstackdump = fopen("netstackdump", "wb");
-       netstackdump_read = fopen("netstackdump_read", "wb");
-+      #ifdef CRYPTO
-+      netstackdump_dec = fopen("netstackdump_dec", "wb");
-+      netstackdump_read_dec = fopen("netstackdump_read_dec", "wb");
-       #endif
-+      #endif
-       LogPrintf("Connecting ...\n");
-@@ -1103,8 +1134,14 @@\r
-       if(netstackdump != 0)
-               fclose(netstackdump);
-       if(netstackdump_read != 0)
--                fclose(netstackdump_read);    
-+                fclose(netstackdump_read);
-+#ifdef CRYPTO
-+      if(netstackdump_dec != 0)
-+              fclose(netstackdump_dec);
-+      if(netstackdump_read_dec != 0)
-+                fclose(netstackdump_read_dec);
- #endif
-+#endif
-       return nStatus;
- }
-Index: rtmppacket.h\r
-===================================================================\r
---- rtmppacket.h       (revision 6)\r
-+++ rtmppacket.h       (working copy)\r
-@@ -23,6 +23,7 @@\r
-  */
- #include <string>
-+#include <stdint.h>
- #define RTMP_PACKET_TYPE_AUDIO 0x08
- #define RTMP_PACKET_TYPE_VIDEO 0x09
-@@ -56,7 +57,7 @@\r
-       BYTE    m_headerType;
-       BYTE    m_packetType;
--      BYTE    m_nChannel;
-+      uint32_t        m_nChannel; // used to be BYTE
-       int32_t m_nInfoField1; // 3 first bytes
-       int32_t m_nInfoField2; // last 4 bytes in a long header, absolute timestamp for long headers, relative timestamp for short headers 
-       bool      m_hasAbsTimestamp; // timestamp absolute or relative?
-Index: rtmp.cpp\r
-===================================================================\r
---- rtmp.cpp   (revision 6)\r
-+++ rtmp.cpp   (working copy)\r
-@@ -388,7 +388,11 @@\r
- #ifdef _DEBUG
- extern FILE *netstackdump;
- extern FILE *netstackdump_read;
-+#ifdef CRYPTO
-+extern FILE *netstackdump_dec;
-+extern FILE *netstackdump_read_dec;
- #endif
-+#endif
- int CRTMP::ReadN(char *buffer, int n)
- {
-@@ -450,6 +454,9 @@\r
-     if(Link.rc4keyIn) {
-       RC4(Link.rc4keyIn, nBytes, (uint8_t*)ptr, (uint8_t*)ptr);
-     }
-+#ifdef _DEBUG
-+        fwrite(ptr, 1, nBytes, netstackdump_read_dec);
-+#endif
-     #endif
-     n -= nBytes;
-@@ -466,6 +473,9 @@\r
-   char *encrypted = 0;
-  
-   #ifdef CRYPTO
-+#ifdef _DEBUG
-+      fwrite(ptr, 1, n, netstackdump_dec);
-+#endif
-   if(Link.rc4keyOut) {
-     ptr = encrypted = (char *)malloc(n);
-     RC4(Link.rc4keyOut, n, (uint8_t*)buffer, (uint8_t*)ptr);
-@@ -990,7 +1000,7 @@\r
- void CRTMP::HandlePing(const RTMPPacket &packet)
- {
--  short nType = -1;
-+  uint16_t nType = -1;
-   if (packet.m_body && packet.m_nBodySize >= 2)
-     nType = ReadInt16(packet.m_body);
-   Log(LOGDEBUG, "%s, received ping. type: %d, len: %d", __FUNCTION__, nType, packet.m_nBodySize);
-@@ -1026,6 +1036,25 @@\r
-   packet.m_headerType = (type & 0xc0) >> 6;
-   packet.m_nChannel = (type & 0x3f);
-+  if (packet.m_nChannel == 0 || packet.m_nChannel == 1)
-+  {
-+    if (ReadN(&type,1) != 1)
-+    {
-+      Log(LOGERROR, "%s, failed to read 2nd RTMP packet header byte", __FUNCTION__);
-+      return false;
-+    }
-+    packet.m_nChannel = 0x40 + type;
-+    if (packet.m_nChannel == 1)
-+    {
-+      if (ReadN(&type,1) != 1)
-+      {
-+        Log(LOGERROR, "%s, failed to read 3rd RTMP packet header byte", __FUNCTION__);
-+        return false;
-+      }
-+      packet.m_nChannel += type << 8; // WARNING untested!
-+    }
-+  }
-+  //Log(LOGDEBUG, "This channel: %lu", packet.m_nChannel);
-   int nSize = packetSize[packet.m_headerType];
-   
-@@ -1109,7 +1138,7 @@\r
-   return true;
- }
--short  CRTMP::ReadInt16(const char *data)
-+int16_t  CRTMP::ReadInt16(const char *data)
- {
-   short val;
-   memcpy(&val,data,sizeof(short));
-@@ -1136,18 +1165,35 @@\r
- std::string CRTMP::ReadString(const char *data)
- {
-   std::string strRes;
--  short len = ReadInt16(data);
-+  uint16_t len = ReadInt16(data);
-+  //Log(LOGDEBUG, "%s: Reading string of length: %d", __FUNCTION__, len);
-   if (len > 0)
-   {
-     char *pStr = new char[len+1]; 
-     memset(pStr, 0, len+1);
--    memcpy(pStr, data + sizeof(short), len);
-+    memcpy(pStr, data + sizeof(uint16_t), len);
-     strRes = pStr;
-     delete [] pStr;
-   }
-   return strRes;
- }
-+std::string CRTMP::ReadLongString(const char *data)
-+{
-+  std::string strRes;
-+  uint32_t len = ReadInt32(data);
-+  Log(LOGDEBUG, "%s: reading %d bytes", __FUNCTION__, len);
-+  if (len > 0)
-+  {
-+    char *pStr = new char[len+1]; 
-+    memset(pStr, 0, len+1);
-+    memcpy(pStr, data + sizeof(uint32_t), len);
-+    strRes = pStr;
-+    delete [] pStr;
-+  }
-+  return strRes;
-+}
-+
- bool CRTMP::ReadBool(const char *data)
- {
-   return *data == 0x01;
-@@ -1347,7 +1393,29 @@\r
-   int nSize = packetSize[packet.m_headerType];
-   char header[RTMP_LARGE_HEADER_SIZE] = { 0 };
--  header[0] = (char)((packet.m_headerType << 6) | packet.m_nChannel);
-+  //header[0] = (char)((packet.m_headerType << 6) | packet.m_nChannel);
-+  if (packet.m_nChannel < 0x40)
-+  {
-+    header[0] = (char)((packet.m_headerType << 6) | packet.m_nChannel);
-+  }
-+  // WARNING Untested:
-+  else if (packet.m_nChannel >= 0x40 && packet.m_nChannel < 0x140)
-+  {
-+    char chan = ((packet.m_headerType << 6) | 0);
-+    if (!WriteN(&chan, 1))
-+      return false;
-+    header[0] = (char)((packet.m_nChannel - 0x40) & 0xff);
-+  }
-+  else if (packet.m_nChannel >= 0x140 && packet.m_nChannel < 0x10040)
-+  {
-+    char chan = ((packet.m_headerType << 6) | 1);
-+    if (!WriteN(&chan, 1))
-+      return false;
-+    chan = (packet.m_nChannel - 0x40) & 0xff;
-+    if (!WriteN(&chan, 1))
-+      return false;
-+    header[0] = (char)(((packet.m_nChannel - 0x40) >> 8) & 0xff);
-+  }
-   if (nSize > 1)
-     EncodeInt24(header+1, packet.m_nInfoField1);
-   
-@@ -1383,13 +1451,38 @@\r
-     if (nSize > 0)
-     {
--      char sep = (0xc0 | packet.m_nChannel);
--      if (!WriteN(&sep, 1))
--        return false;  
-+      if (packet.m_nChannel < 0x40)
-+      {
-+        char sep = (0xc0 | packet.m_nChannel);
-+        if (!WriteN(&sep, 1))
-+          return false;
-+      }
-+      // WARNING Untested:
-+      else if (packet.m_nChannel >= 0x40 && packet.m_nChannel < 0x140)
-+      {
-+        char sep = (0xc0 | 0);
-+        if (!WriteN(&sep, 1))
-+          return false;
-+        sep = (packet.m_nChannel - 0x40) & 0xff;
-+        if (!WriteN(&sep, 1))
-+          return false;
-+      }
-+      else if (packet.m_nChannel >= 0x140 && packet.m_nChannel < 0x10040)
-+      {
-+        char sep = (0xc0 | 1);
-+        if (!WriteN(&sep, 1))
-+          return false;
-+        sep = (packet.m_nChannel - 0x40) & 0xff;
-+        if (!WriteN(&sep, 1))
-+          return false;
-+        sep = ((packet.m_nChannel - 0x40) >> 8) & 0xff;
-+        if (!WriteN(&sep, 1))
-+          return false;
-+      }
-     }
-   }
--  if (packet.m_packetType == 0x14) // we invoked a remote method, keep it in call queue till result arrives
-+  if (packet.m_packetType == 0x14 && ReadString(packet.m_body + 1) != "_result") // we invoked a remote method, keep it in call queue till result arrives, providing that we're not sending a result ourselves
-     m_methodCalls.push_back(ReadString(packet.m_body + 1));
-   m_vecChannelsOut[packet.m_nChannel] = packet;
-@@ -1408,7 +1501,8 @@\r
-   m_nBytesIn = 0;
-   m_nBytesInSent = 0;
--  for (int i=0; i<64; i++)
-+  //for (int i=0; i<64; i++)
-+  for (int i=0; i<65600; i++)
-   {
-     m_vecChannelsIn[i].Reset();
-     m_vecChannelsIn[i].m_nChannel = i;
-Index: rtmp.h\r
-===================================================================\r
---- rtmp.h     (revision 6)\r
-+++ rtmp.h     (working copy)\r
-@@ -141,10 +141,11 @@\r
-       static int EncodeInt32(char *output, int nVal);
-       static int EncodeBoolean(char *output,bool bVal);
--      static short ReadInt16(const char *data);
-+      static int16_t ReadInt16(const char *data);
-       static int  ReadInt24(const char *data);
-       static int  ReadInt32(const char *data);
-       static std::string ReadString(const char *data);
-+      static std::string ReadLongString(const char *data);
-       static bool ReadBool(const char *data);
-       static double ReadNumber(const char *data);
-@@ -205,9 +206,9 @@\r
-       char *m_pBuffer;      // data read from socket
-       char *m_pBufferStart; // pointer into m_pBuffer of next byte to process
-       int  m_nBufferSize;   // number of unprocessed bytes in buffer
--      RTMPPacket m_vecChannelsIn[64];
--      RTMPPacket m_vecChannelsOut[64];
--      int  m_channelTimestamp[64]; // abs timestamp of last packet
-+      RTMPPacket m_vecChannelsIn[65600];
-+      RTMPPacket m_vecChannelsOut[65600];
-+      int  m_channelTimestamp[65600]; // abs timestamp of last packet
-       double m_fDuration; // duration of stream in seconds
-   };
-Index: AMFObject.cpp\r
-===================================================================\r
---- AMFObject.cpp      (revision 4)\r
-+++ AMFObject.cpp      (working copy)\r
-@@ -383,7 +383,7 @@\r
-   if (bDecodeName)
-   {
--    unsigned short nNameSize = RTMP_LIB::CRTMP::ReadInt16(pBuffer);
-+    uint16_t nNameSize = RTMP_LIB::CRTMP::ReadInt16(pBuffer);
-     if (nNameSize > nSize - 2) {
-       Log(LOGDEBUG,"%s: Name size out of range: namesize (%d) > len (%d) - 2", __FUNCTION__, nNameSize, nSize);
-       return -1;
-@@ -420,7 +420,7 @@\r
-       break;
-     case 0x02: // AMF_STRING:
-     {
--      unsigned short nStringSize = RTMP_LIB::CRTMP::ReadInt16(pBuffer+1);
-+      uint16_t nStringSize = RTMP_LIB::CRTMP::ReadInt16(pBuffer+1);
-       //Log(LOGDEBUG, "Read string, len: %d\n", nStringSize);
-       //LogHex(pBuffer, nSize);
-@@ -500,10 +500,11 @@\r
-     {
-       Log(LOGWARNING, "AMF_LONG_STRING not tested!");
-       
--      unsigned int nStringSize = RTMP_LIB::CRTMP::ReadInt32(pBuffer+1);;
-+      unsigned int nStringSize = RTMP_LIB::CRTMP::ReadInt32(pBuffer+1);
-+      Log(LOGDEBUG, "nSize:[%d] nStringSize:[%d]", nSize, nStringSize);
-         if (nSize < (long)nStringSize + 4)
-           return -1;
--        m_strVal = RTMP_LIB::CRTMP::ReadString(pBuffer+1);
-+        m_strVal = RTMP_LIB::CRTMP::ReadLongString(pBuffer+1);
-         nSize -= (4 + nStringSize);
-         m_type = AMF_STRING;
-       break;
index e26a91346f3c9d39827fa3281f45602f4facd804..4984518eb8893093053d7fcb316aaf8f4e88178a 100644 (file)
@@ -1,5 +1,6 @@
 /*  RTMPDump
  *  Copyright (C) 2009 Andrej Stepanchuk
+ *  Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
index cb5fa67ae9d6cea39b4f12e7943e2a471fb46b8d..78743ec8ff26722c146df4f847caea56ceb3324d 100644 (file)
@@ -2,6 +2,7 @@
 #define _PARSEURL_H_
 /*  RTMPDump
  *  Copyright (C) 2009 Andrej Stepanchuk
+ *  Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
index efb93c628e2702c2d3e04c2520511f3aa0302fb4..aaa39a8f969877b32c26bc0367283fc2773a278d 100644 (file)
--- a/rtmp.cpp
+++ b/rtmp.cpp
@@ -2,6 +2,7 @@
  *      Copyright (C) 2005-2008 Team XBMC
  *      http://www.xbmc.org
  *      Copyright (C) 2008-2009 Andrej Stepanchuk
+ *      Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
diff --git a/rtmp.h b/rtmp.h
index 5160ef949b729031fd1542e05bc913961bf2e230..155a998b9c666fe3e52dd4579283eac26b2908d5 100644 (file)
--- a/rtmp.h
+++ b/rtmp.h
@@ -4,6 +4,7 @@
  *      Copyright (C) 2005-2008 Team XBMC
  *      http://www.xbmc.org
  *      Copyright (C) 2008-2009 Andrej Stepanchuk
+ *      Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
index 96bc7b3852e73d49be480a442a13523640147579..1137528e7b91c4d32495a9bddb27a56ba6ed2df7 100644 (file)
@@ -1,5 +1,6 @@
 /*  RTMPDump
  *  Copyright (C) 2009 Andrej Stepanchuk
+ *  Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -38,7 +39,7 @@ int debuglevel = 1;
 
 using namespace RTMP_LIB;
 
-#define RTMPDUMP_VERSION       "v1.6"
+#define RTMPDUMP_VERSION       "v1.7"
 
 #define RD_SUCCESS             0
 #define RD_FAILED              1
@@ -778,13 +779,13 @@ int Download(CRTMP *rtmp,                      // connected CRTMP object
                                *percent = round(*percent*10.0)/10.0;
                                now = GetTime();
                                if (abs(now - lastUpdate) > 200) {
-                                       LogPrintf("\r%.3f kB (%.1f%%)", (double)size/1024.0, *percent);
+                                       LogStatus("\r%.3f kB (%.1f%%)", (double)size/1024.0, *percent);
                                        lastUpdate = now;
                                }
                        } else {
                                now = GetTime();
                                if (abs(now - lastUpdate) > 200) {
-                                       LogPrintf("\r%.3f kB", (double)size/1024.0);
+                                       LogStatus("\r%.3f kB", (double)size/1024.0);
                                        lastUpdate = now;
                                }
                        }
@@ -795,7 +796,7 @@ int Download(CRTMP *rtmp,                      // connected CRTMP object
 
                // Force clean close if a specified stop offset is reached
                 if (dStopOffset && timestamp >= dStopOffset) {
-                        LogPrintf("\nStop offset has been reached at %.2f seconds\n", (double)dStopOffset/1000.0);
+                        LogPrintf("Stop offset has been reached at %.2f seconds\n", (double)dStopOffset/1000.0);
                         nRead = 0;
                         rtmp->Close();
                 }
@@ -1303,9 +1304,9 @@ int main(int argc, char **argv)
        }
 
        if (nStatus == RD_SUCCESS) {
-               LogPrintf("\nDownload complete\n");
+               LogPrintf("Download complete\n");
        } else if (nStatus == RD_INCOMPLETE)  {
-               LogPrintf("\nDownload may be incomplete (downloaded about %.2f%%), try --resume\n", percent);
+               LogPrintf("Download may be incomplete (downloaded about %.2f%%), try --resume\n", percent);
        }
 
 clean:
index 07c96e03f7c67f12b12809f6277960f886ae9c55..150f9b5b5268fb035981f9e526de64e5a4334c61 100644 (file)
@@ -2,6 +2,7 @@
  *      Copyright (C) 2005-2008 Team XBMC
  *      http://www.xbmc.org
  *      Copyright (C) 2008-2009 Andrej Stepanchuk
+ *      Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
index 05589232aea284d6e2abab5a045a8f085906ad1a..2238823488bd3e83ffb8d624083b7a2575ca30c2 100644 (file)
@@ -4,6 +4,7 @@
  *      Copyright (C) 2005-2008 Team XBMC
  *      http://www.xbmc.org
  *     Copyright (C) 2008-2009 Andrej Stepanchuk
+ *     Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
index 9ad9f8e62fbfcaae5afd0dc3eb8452b3d68012ae..73314aeb95f7846df585e33d6a85aeacec7944b2 100644 (file)
@@ -1,5 +1,6 @@
 /*  HTTP-RTMP Stream Server
  *  Copyright (C) 2009 Andrej Stepanchuk
+ *  Copyright (C) 2009 Howard Chu
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by