r16 - README bytes.c dh.c dh.h handshake.cpp log.c log.h more-than-64-channels.patch parseurl.c parseurl.h rtmp.cpp rtmp.h rtmpdump.cpp rtmppacket.cpp rtmppacket.h streams.cpp
Author: hyc Date: Sat Oct 31 03:25:22 2009 New Revision: 16 Log: Version updates Deleted: more-than-64-channels.patch Modified: README bytes.c dh.c dh.h handshake.cpp log.c log.h parseurl.c parseurl.h rtmp.cpp rtmp.h rtmpdump.cpp rtmppacket.cpp rtmppacket.h streams.cpp Modified: README ============================================================================== --- README Sat Oct 31 01:54:28 2009 (r15) +++ README Sat Oct 31 03:25:22 2009 (r16) @@ -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 Modified: bytes.c ============================================================================== --- bytes.c Sat Oct 31 01:54:28 2009 (r15) +++ bytes.c Sat Oct 31 03:25:22 2009 (r16) @@ -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 Modified: dh.c ============================================================================== --- dh.c Sat Oct 31 01:54:28 2009 (r15) +++ dh.c Sat Oct 31 03:25:22 2009 (r16) @@ -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 Modified: dh.h ============================================================================== --- dh.h Sat Oct 31 01:54:28 2009 (r15) +++ dh.h Sat Oct 31 03:25:22 2009 (r16) @@ -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 Modified: handshake.cpp ============================================================================== --- handshake.cpp Sat Oct 31 01:54:28 2009 (r15) +++ handshake.cpp Sat Oct 31 03:25:22 2009 (r16) @@ -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 Modified: log.c ============================================================================== --- log.c Sat Oct 31 01:54:28 2009 (r15) +++ log.c Sat Oct 31 03:25:22 2009 (r16) @@ -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) Modified: log.h ============================================================================== --- log.h Sat Oct 31 01:54:28 2009 (r15) +++ log.h Sat Oct 31 03:25:22 2009 (r16) @@ -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); Modified: parseurl.c ============================================================================== --- parseurl.c Sat Oct 31 01:54:28 2009 (r15) +++ parseurl.c Sat Oct 31 03:25:22 2009 (r16) @@ -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 Modified: parseurl.h ============================================================================== --- parseurl.h Sat Oct 31 01:54:28 2009 (r15) +++ parseurl.h Sat Oct 31 03:25:22 2009 (r16) @@ -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 Modified: rtmp.cpp ============================================================================== --- rtmp.cpp Sat Oct 31 01:54:28 2009 (r15) +++ rtmp.cpp Sat Oct 31 03:25:22 2009 (r16) @@ -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 Modified: rtmp.h ============================================================================== --- rtmp.h Sat Oct 31 01:54:28 2009 (r15) +++ rtmp.h Sat Oct 31 03:25:22 2009 (r16) @@ -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 Modified: rtmpdump.cpp ============================================================================== --- rtmpdump.cpp Sat Oct 31 01:54:28 2009 (r15) +++ rtmpdump.cpp Sat Oct 31 03:25:22 2009 (r16) @@ -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, *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, // 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: Modified: rtmppacket.cpp ============================================================================== --- rtmppacket.cpp Sat Oct 31 01:54:28 2009 (r15) +++ rtmppacket.cpp Sat Oct 31 03:25:22 2009 (r16) @@ -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 Modified: rtmppacket.h ============================================================================== --- rtmppacket.h Sat Oct 31 01:54:28 2009 (r15) +++ rtmppacket.h Sat Oct 31 03:25:22 2009 (r16) @@ -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 Modified: streams.cpp ============================================================================== --- streams.cpp Sat Oct 31 01:54:28 2009 (r15) +++ streams.cpp Sat Oct 31 03:25:22 2009 (r16) @@ -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
participants (1)
-
hyc