[rtmpdump] Multiple small fixes for rtmpdump
LRN
lrn1986 at gmail.com
Tue Mar 18 13:13:21 CET 2014
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Patches are attached.
0003-better-w32-threading.all.patch:
Use _beginthreadex() instead of _beginthread() (better error handling).
0004-gnu_printf.all.patch:
Use gnu_printf format, this makes it explicit that rtmpdump expects
GNU-printf-compatible format strings (as opposed to
MS-printf-compatible) when compiling for W32. This fixes gcc warning
about the use of %ll size specifier (gcc thinks that msvcrt printf
does not support it, and it didn't until certain MSVCR version).
0005-fix-unused-var-warning.all.patch:
0006-deprecated-gnutls-type.all.patch:
0007-cast-appropriately-for-nettle.all.patch:
0008-unused-variable-warning-fix.all.patch:
0009-correct-cast.all.patch:
0010-unused-variable-fix.all.patch:
These fix warnings.
0011-fix-parallel-install.all.patch:
install_so target runs $(INSTALL_IMPLIB), which needs libdir, which is
created as a side-effect of install_base taret, so make install_base a
prerequisite of install_so.
- --
O< ascii ribbon - stop html email! - www.asciiribbon.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
iQEcBAEBAgAGBQJTKDhhAAoJEOs4Jb6SI2CwI/UIANBn4p5r0vkXETi+wVjPP6lP
u5Lv8Kn7Eij34/bA7PA9YHLRrzrFA2vTE5YWDoF8CKWM2SAT2ArjtmQnbv82dBvf
MJvZEj2D/2hQbkpQs5p23jMvV0XXZ0Y4m/rvt7va/wBtOLx18NwheUFJOhN/dVvh
qCb7VQ7W6T0gwV4YiNgQLEbpaGwNkNCJcVJAHw44DNeQHtVXu59Kl5dV4vgvo9D8
QeZGuaMntOiHwLx6bUePOY78gv4EJg8SlcrZPsPTQSuf+xXGVUwj4SS6dvkr8DgG
jKrmh4+FaMFgRW8BoGJegfREt544AMBVICwV0z1js8kemHgCn79mhmDLFtgchmU=
=WFvw
-----END PGP SIGNATURE-----
-------------- next part --------------
--- rtmpdump/librtmp/log.h.orig 2014-03-02 18:20:23.000000000 +0000
+++ rtmpdump/librtmp/log.h 2014-03-12 09:23:45.011220200 +0000
@@ -49,9 +49,9 @@
void RTMP_LogSetCallback(RTMP_LogCallback *cb);
void RTMP_LogSetOutput(FILE *file);
#ifdef __GNUC__
-void RTMP_LogPrintf(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
-void RTMP_LogStatus(const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
-void RTMP_Log(int level, const char *format, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
+void RTMP_LogPrintf(const char *format, ...) __attribute__ ((__format__ (gnu_printf, 1, 2)));
+void RTMP_LogStatus(const char *format, ...) __attribute__ ((__format__ (gnu_printf, 1, 2)));
+void RTMP_Log(int level, const char *format, ...) __attribute__ ((__format__ (gnu_printf, 2, 3)));
#else
void RTMP_LogPrintf(const char *format, ...);
void RTMP_LogStatus(const char *format, ...);
-------------- next part --------------
--- rtmpdump/librtmp/handshake.h.orig 2014-03-02 18:20:23.000000000 +0000
+++ rtmpdump/librtmp/handshake.h 2014-03-12 09:26:06.474683800 +0000
@@ -134,6 +134,7 @@
HMAC_setup(ctx, secretKey, 128);
HMAC_crunch(ctx, pubKeyOut, 128);
HMAC_finish(ctx, digest, digestLen);
+ (void) digestLen;
RTMP_Log(RTMP_LOGDEBUG, "RC4 In Key: ");
RTMP_LogHex(RTMP_LOGDEBUG, digest, 16);
-------------- next part --------------
--- rtmpdump/librtmp/rtmp.c.orig 2014-03-02 18:20:23.000000000 +0000
+++ rtmpdump/librtmp/rtmp.c 2014-03-12 09:27:08.312536200 +0000
@@ -272,7 +272,7 @@
return NULL;
}
#elif defined(USE_GNUTLS) && !defined(NO_SSL)
- gnutls_certificate_allocate_credentials((gnutls_certificate_credentials*) &ctx);
+ gnutls_certificate_allocate_credentials((gnutls_certificate_credentials_t *) &ctx);
if (gnutls_certificate_set_x509_key_file(ctx, cert, key, GNUTLS_X509_FMT_PEM) != 0) {
gnutls_certificate_free_credentials(ctx);
return NULL;
-------------- next part --------------
--- rtmpdump/librtmp/rtmp.c.orig 2014-03-12 09:27:27.855517800 +0000
+++ rtmpdump/librtmp/rtmp.c 2014-03-12 09:32:34.378941400 +0000
@@ -2485,7 +2485,7 @@
#elif defined(USE_GNUTLS)
typedef struct md5_ctx MD5_CTX;
#define MD5_Init(ctx) md5_init(ctx)
-#define MD5_Update(ctx,data,len) md5_update(ctx,len,data)
+#define MD5_Update(ctx,data,len) md5_update(ctx,(unsigned) len,(const uint8_t *) data)
#define MD5_Final(dig,ctx) md5_digest(ctx,MD5_DIGEST_LENGTH,dig)
#else
#endif
-------------- next part --------------
--- rtmpdump/librtmp/rtmp.c.orig 2014-03-12 09:33:00.164715700 +0000
+++ rtmpdump/librtmp/rtmp.c 2014-03-12 09:35:01.513625100 +0000
@@ -3572,7 +3572,6 @@
uint8_t hbuf[RTMP_MAX_HEADER_SIZE] = { 0 };
char *header = (char *)hbuf;
int nSize, hSize, nToRead, nChunk;
- int didAlloc = FALSE;
int extendedTimestamp;
RTMP_Log(RTMP_LOGDEBUG2, "%s: fd=%d", __FUNCTION__, r->m_sb.sb_socket);
@@ -3700,7 +3699,6 @@
RTMP_Log(RTMP_LOGDEBUG, "%s, failed to allocate packet", __FUNCTION__);
return FALSE;
}
- didAlloc = TRUE;
packet->m_headerType = (hbuf[0] & 0xc0) >> 6;
}
-------------- next part --------------
--- rtmpdump/librtmp/hashswf.c.orig 2014-03-02 18:20:23.000000000 +0000
+++ rtmpdump/librtmp/hashswf.c 2014-03-12 09:37:14.957070300 +0000
@@ -48,7 +48,7 @@
#endif
#undef HMAC_CTX
#define HMAC_CTX struct hmac_sha256_ctx
-#define HMAC_setup(ctx, key, len) hmac_sha256_set_key(&ctx, len, key)
+#define HMAC_setup(ctx, key, len) hmac_sha256_set_key(&ctx, len, (const uint8_t *) key)
#define HMAC_crunch(ctx, buf, len) hmac_sha256_update(&ctx, len, buf)
#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig)
#define HMAC_close(ctx)
-------------- next part --------------
--- rtmpdump/rtmpsrv.c.orig 2014-03-02 18:20:23.000000000 +0000
+++ rtmpdump/rtmpsrv.c 2014-03-12 09:38:24.445894200 +0000
@@ -404,10 +404,10 @@
static char *
dumpAMF(AMFObject *obj, char *ptr, AVal *argv, int *argc)
{
- int i, len, ac = *argc;
+ int i, ac = *argc;
const char opt[] = "NBSO Z";
- for (i=0, len=0; i < obj->o_num; i++)
+ for (i=0; i < obj->o_num; i++)
{
AMFObjectProperty *p = &obj->o_props[i];
argv[ac].av_val = ptr+1;
-------------- next part --------------
--- rtmpdump/librtmp/Makefile.orig 2014-03-12 09:49:51.274110300 +0000
+++ rtmpdump/librtmp/Makefile 2014-03-12 09:50:07.689194800 +0000
@@ -114,7 +114,7 @@
cp librtmp.pc $(LIBDIR)/pkgconfig
cp librtmp.3 $(MANDIR)/man3
-install_so: librtmp$(SO_EXT)
+install_so: librtmp$(SO_EXT) install_base
cp librtmp$(SO_EXT) $(SODIR)
$(INSTALL_IMPLIB)
cd $(SODIR); ln -sf librtmp$(SO_EXT) librtmp.$(SOX)
-------------- next part --------------
--- rtmpdump/thread.c.orig 2014-03-02 18:20:23.000000000 +0000
+++ rtmpdump/thread.c 2014-03-12 09:20:02.337444200 +0000
@@ -30,10 +30,14 @@
ThreadCreate(thrfunc *routine, void *args)
{
HANDLE thd;
+ uintptr_t success;
- thd = (HANDLE) _beginthread(routine, 0, args);
- if (thd == -1L)
+ success = _beginthreadex(NULL, 0, routine, args, 0, (unsigned *)&thd);
+ if (!success)
+ {
RTMP_LogPrintf("%s, _beginthread failed with %d\n", __FUNCTION__, errno);
+ return INVALID_HANDLE_VALUE;
+ }
return thd;
}
--- rtmpdump/thread.h.orig 2014-03-02 18:20:23.000000000 +0000
+++ rtmpdump/thread.h 2014-03-12 09:22:17.183567500 +0000
@@ -25,8 +25,8 @@
#ifdef WIN32
#include <windows.h>
#include <process.h>
-#define TFTYPE void
-#define TFRET()
+#define TFTYPE unsigned int __stdcall
+#define TFRET() return 0
#define THANDLE HANDLE
#else
#include <pthread.h>
More information about the rtmpdump
mailing list