Projects
Essentials
rtmpdump
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 7
View file
rtmpdump.changes
Changed
@@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Thu Dec 15 14:15:45 UTC 2011 - ismail@namtrac.org + +- Update to latest git as of 14.11.2011 + * Fix getting swf hash with https URLs + * Fix bytes-received report +- Cleanup spec file + +------------------------------------------------------------------- Thu Jul 28 13:44:18 UTC 2011 - idoenmez@suse.de - Update to latest git as of 28.07.2011
View file
rtmpdump.spec
Changed
@@ -1,20 +1,27 @@ -# norootforbuild - -Name: rtmpdump -Version: 2.3.99.git20110728 +# vim: set sw=3 ts=3 noet: +# +# spec file for package rtmpdump +# + +Name: rtmpdump +Version: 2.3.99.git20111114 +Release: 0 +License: GPL-2.0 %define soname 0 -Release: 1 -Summary: RTMP Stream Dumper -Source: rtmpdump-%{version}.tar.bz2 -Patch1: rtmpdump-fix_u32.patch -Source99: rtmpdump-rpmlintrc -URL: http://rtmpdump.mplayerhq.hu/ -Group: Productivity/Networking/Other -License: GNU General Public License version 2 (GPL v2) -BuildRoot: %{_tmppath}/build-%{name}-%{version} -BuildRequires: zlib-devel openssl-devel -BuildRequires: make glibc-devel gcc pkgconfig -Requires: librtmp%{soname} = %{version} +Summary: RTMP Stream Dumper +Url: http://rtmpdump.mplayerhq.hu/ +Group: Productivity/Networking/Other +Source: rtmpdump-%{version}.tar.bz2 +Patch1: rtmpdump-fix_u32.patch +Source99: rtmpdump-rpmlintrc +BuildRequires: gcc +BuildRequires: glibc-devel +BuildRequires: make +BuildRequires: openssl-devel +BuildRequires: pkgconfig +BuildRequires: zlib-devel +Requires: librtmp%{soname} = %{version} +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description A small dumper for media content streamed over the RTMP protocol (like BBC's @@ -22,8 +29,8 @@ flv file, which can be played/transcoded using ffmpeg/mplayer, etc. %package -n librtmp%{soname} -Summary: RTMP Stream Dumper Library -Group: System/Libraries +Summary: RTMP Stream Dumper Library +Group: System/Libraries %description -n librtmp%{soname} A small dumper for media content streamed over the RTMP protocol (like BBC's @@ -31,27 +38,27 @@ flv file, which can be played/transcoded using ffmpeg/mplayer, etc. %package -n rtmpsuck -Summary: RTMP Transparent Proxy Server -Group: Productivity/Networking/Other -Requires: librtmp%{soname} = %{version} +Summary: RTMP Transparent Proxy Server +Group: Productivity/Networking/Other +Requires: librtmp%{soname} = %{version} %description -n rtmpsuck Proxy server that dumps RTMP streams. %package -n rtmpsrv -Summary: RTMP Server -Group: Productivity/Networking/Other -Requires: librtmp%{soname} = %{version} +Summary: RTMP Server +Group: Productivity/Networking/Other +Requires: librtmp%{soname} = %{version} %description -n rtmpsrv Server for RTMP streams. %package -n rtmpgw -Summary: RTMP to HTTP Gateway -Group: Productivity/Networking/Other -Obsoletes: streams < %{version} -Provides: streams = %{version} -Requires: librtmp%{soname} = %{version} +Summary: RTMP to HTTP Gateway +Group: Productivity/Networking/Other +Requires: librtmp%{soname} = %{version} +Obsoletes: streams < %{version} +Provides: streams = %{version} %description -n rtmpgw HTTP gateway: this is an HTTP server that accepts requests that consist of @@ -59,35 +66,34 @@ the retrieved data in the HTTP response. %package -n librtmp-devel -Summary: RTMP Stream Dumping Library -Group: Development/Libraries/C and C++ +Summary: RTMP Stream Dumping Library +Group: Development/Libraries/C and C++ %if 0%{?suse_version} >= 1030 -Requires: libopenssl-devel +Requires: libopenssl-devel %else -Requires: openssl-devel +Requires: openssl-devel %endif -Requires: librtmp%{soname} = %{version} +Requires: librtmp%{soname} = %{version} %description -n librtmp-devel A small dumper for media content streamed over the RTMP protocol (like BBC's iPlayer high quality streams). Supplying an rtmp url will result in a dumped flv file, which can be played/transcoded using ffmpeg/mplayer, etc. - %prep %setup -q %patch1 %build -%__make \ - CC="%__cc" \ +make \ + CC="gcc" \ OPT="%{optflags}" \ prefix="%{_prefix}" \ libdir="%{_libdir}" \ MANDIR="%{_mandir}" -%__make -C librtmp \ - CC="%__cc" \ +make -C librtmp \ + CC="gcc" \ OPT="%{optflags}" \ prefix="%{_prefix}" \ libdir="%{_libdir}" \ @@ -95,12 +101,12 @@ librtmp.pc %install -%__install -d "%{buildroot}%{_bindir}" -find . -mindepth 1 -maxdepth 1 -type f -executable -exec %__install -m0755 {} "%{buildroot}%{_bindir}/" \; +install -d "%{buildroot}%{_bindir}" +find . -mindepth 1 -maxdepth 1 -type f -executable -exec install -m0755 {} "%{buildroot}%{_bindir}/" \; pushd librtmp -%__install -d "%{buildroot}%{_includedir}/librtmp" "%{buildroot}%{_libdir}" "%{buildroot}%{_libdir}/pkgconfig" -%__make \ +install -d "%{buildroot}%{_includedir}/librtmp" "%{buildroot}%{_libdir}" "%{buildroot}%{_libdir}/pkgconfig" +make \ prefix="%{buildroot}%{_prefix}" \ libdir="%{buildroot}%{_libdir}" \ INCDIR="%{buildroot}%{_includedir}/librtmp" \ @@ -111,9 +117,6 @@ %post -n librtmp%{soname} -p /sbin/ldconfig %postun -n librtmp%{soname} -p /sbin/ldconfig -%clean -%__rm -rf "%{buildroot}" - %files %defattr(-,root,root) %doc README ChangeLog COPYING @@ -147,8 +150,9 @@ %{_libdir}/pkgconfig/librtmp.pc %doc %{_mandir}/man3/librtmp.3%{ext_man} -# vim: set sw=3 ts=3 noet: # Local Variables: # mode: rpm-spec # tab-width: 3 # End: + +%changelog
View file
rtmpdump-2.3.99.git20110728.tar.bz2/README -> rtmpdump-2.3.99.git20111114.tar.bz2/README
Changed
@@ -50,6 +50,7 @@ The rtmpdump programs still link to the static library, regardless. Note that if using OpenSSL, you must have version 0.9.8 or newer. +For Polar SSL you must have version 1.0.0 or newer. Credit goes to team boxee for the XBMC RTMP code originally used in RTMPDumper. The current code is based on the XBMC code but rewritten in C by Howard Chu.
View file
rtmpdump-2.3.99.git20110728.tar.bz2/librtmp/Makefile -> rtmpdump-2.3.99.git20111114.tar.bz2/librtmp/Makefile
Changed
@@ -52,8 +52,8 @@ SODIR=$(SODIR_$(SYS)) SO_LDFLAGS_posix=-shared -Wl,-soname,$@ -SO_LDFLAGS_darwin=-dynamiclib -flat_namespace -undefined suppress -fno-common \ - -headerpad_max_install_names +SO_LDFLAGS_darwin=-dynamiclib -twolevel_namespace -undefined dynamic_lookup \ + -fno-common -headerpad_max_install_names -install_name $(libdir)/$@ SO_LDFLAGS_mingw=-shared -Wl,--out-implib,librtmp.dll.a SO_LDFLAGS=$(SO_LDFLAGS_$(SYS))
View file
rtmpdump-2.3.99.git20110728.tar.bz2/librtmp/amf.c -> rtmpdump-2.3.99.git20111114.tar.bz2/librtmp/amf.c
Changed
@@ -586,7 +586,7 @@ case AMF3_ARRAY: case AMF3_BYTE_ARRAY: default: - RTMP_Log(RTMP_LOGDEBUG, "%s - AMF3 unknown/unsupported datatype 0x%02x, @0x%08X", + RTMP_Log(RTMP_LOGDEBUG, "%s - AMF3 unknown/unsupported datatype 0x%02x, @%p", __FUNCTION__, (unsigned char)(*pBuffer), pBuffer); return -1; } @@ -772,7 +772,7 @@ break; } default: - RTMP_Log(RTMP_LOGDEBUG, "%s - unknown datatype 0x%02x, @0x%08X", __FUNCTION__, + RTMP_Log(RTMP_LOGDEBUG, "%s - unknown datatype 0x%02x, @%p", __FUNCTION__, prop->p_type, pBuffer - 1); return -1; } @@ -1111,7 +1111,7 @@ if (!(obj->o_num & 0x0f)) obj->o_props = realloc(obj->o_props, (obj->o_num + 16) * sizeof(AMFObjectProperty)); - obj->o_props[obj->o_num++] = *prop; + memcpy(&obj->o_props[obj->o_num++], prop, sizeof(AMFObjectProperty)); } int
View file
rtmpdump-2.3.99.git20110728.tar.bz2/librtmp/dh.h -> rtmpdump-2.3.99.git20111114.tar.bz2/librtmp/dh.h
Changed
@@ -30,14 +30,14 @@ #ifdef USE_POLARSSL #include <polarssl/dhm.h> typedef mpi * MP_t; -#define MP_new(m) m = malloc(sizeof(mpi)); mpi_init(m, NULL) +#define MP_new(m) m = malloc(sizeof(mpi)); mpi_init(m) #define MP_set_w(mpi, w) mpi_lset(mpi, w) #define MP_cmp(u, v) mpi_cmp_mpi(u, v) #define MP_set(u, v) mpi_copy(u, v) #define MP_sub_w(mpi, w) mpi_sub_int(mpi, mpi, w) #define MP_cmp_1(mpi) mpi_cmp_int(mpi, 1) #define MP_modexp(r, y, q, p) mpi_exp_mod(r, y, q, p, NULL) -#define MP_free(mpi) mpi_free(mpi, NULL); free(mpi) +#define MP_free(mpi) mpi_free(mpi); free(mpi) #define MP_gethex(u, hex, res) MP_new(u); res = mpi_read_string(u, 16, hex) == 0 #define MP_bytes(u) mpi_size(u) #define MP_setbin(u,buf,len) mpi_write_binary(u,buf,len) @@ -71,9 +71,8 @@ static int MDH_compute_key(uint8_t *secret, size_t len, MP_t pub, MDH *dh) { - int n = len; MP_set(&dh->ctx.GY, pub); - dhm_calc_secret(&dh->ctx, secret, &n); + dhm_calc_secret(&dh->ctx, secret, &len); return 0; }
View file
rtmpdump-2.3.99.git20110728.tar.bz2/librtmp/hashswf.c -> rtmpdump-2.3.99.git20111114.tar.bz2/librtmp/hashswf.c
Changed
@@ -141,7 +141,7 @@ return HTTPRES_LOST_CONNECTION; i = sprintf(sb.sb_buf, - "GET %s HTTP/1.0\r\nUser-Agent: %s\r\nHost: %s\r\nReferrer: %.*s\r\n", + "GET %s HTTP/1.0\r\nUser-Agent: %s\r\nHost: %s\r\nReferer: %.*s\r\n", path, AGENT, host, (int)(path - url + 1), url); if (http->date[0]) i += sprintf(sb.sb_buf + i, "If-Modified-Since: %s\r\n", http->date); @@ -163,7 +163,7 @@ #else TLS_client(RTMP_TLS_ctx, sb.sb_ssl); TLS_setfd(sb.sb_ssl, sb.sb_socket); - if ((i = TLS_connect(sb.sb_ssl)) < 0) + if (TLS_connect(sb.sb_ssl) < 0) { RTMP_Log(RTMP_LOGERROR, "%s, TLS_Connect failed", __FUNCTION__); ret = HTTPRES_LOST_CONNECTION;
View file
rtmpdump-2.3.99.git20110728.tar.bz2/librtmp/log.h -> rtmpdump-2.3.99.git20111114.tar.bz2/librtmp/log.h
Changed
@@ -48,9 +48,15 @@ typedef void (RTMP_LogCallback)(int level, const char *fmt, va_list); 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))); +#else void RTMP_LogPrintf(const char *format, ...); void RTMP_LogStatus(const char *format, ...); void RTMP_Log(int level, const char *format, ...); +#endif void RTMP_LogHex(int level, const uint8_t *data, unsigned long len); void RTMP_LogHexString(int level, const uint8_t *data, unsigned long len); void RTMP_LogSetLevel(RTMP_LogLevel lvl);
View file
rtmpdump-2.3.99.git20110728.tar.bz2/librtmp/rtmp.c -> rtmpdump-2.3.99.git20111114.tar.bz2/librtmp/rtmp.c
Changed
@@ -185,7 +185,7 @@ RTMPPacket_Dump(RTMPPacket *p) { RTMP_Log(RTMP_LOGDEBUG, - "RTMP PACKET: packet type: 0x%02x. channel: 0x%02x. info 1: %d info 2: %d. Body size: %lu. body: 0x%02x", + "RTMP PACKET: packet type: 0x%02x. channel: 0x%02x. info 1: %d info 2: %d. Body size: %u. body: 0x%02x", p->m_packetType, p->m_nChannel, p->m_nTimeStamp, p->m_nInfoField2, p->m_nBodySize, p->m_body ? (unsigned char)p->m_body[0] : 0); } @@ -367,7 +367,7 @@ RTMP_Log(RTMP_LOGDEBUG, "StopTime : %d msec", dStop); RTMP_Log(RTMP_LOGDEBUG, "live : %s", bLiveStream ? "yes" : "no"); - RTMP_Log(RTMP_LOGDEBUG, "timeout : %d sec", timeout); + RTMP_Log(RTMP_LOGDEBUG, "timeout : %ld sec", timeout); #ifdef CRYPTO if (swfSHA256Hash != NULL && swfSize > 0) @@ -376,7 +376,7 @@ r->Link.SWFSize = swfSize; RTMP_Log(RTMP_LOGDEBUG, "SWFSHA256:"); RTMP_LogHex(RTMP_LOGDEBUG, r->Link.SWFHash, sizeof(r->Link.SWFHash)); - RTMP_Log(RTMP_LOGDEBUG, "SWFSize : %lu", r->Link.SWFSize); + RTMP_Log(RTMP_LOGDEBUG, "SWFSize : %u", r->Link.SWFSize); } else { @@ -974,7 +974,7 @@ } else { - RTMP_Log(RTMP_LOGERROR, "%s, SOCKS returned error code %d", packet[1]); + RTMP_Log(RTMP_LOGERROR, "%s, SOCKS returned error code %d", __FUNCTION__, packet[1]); return FALSE; } } @@ -1161,14 +1161,14 @@ case RTMP_PACKET_TYPE_FLEX_STREAM_SEND: /* flex stream send */ RTMP_Log(RTMP_LOGDEBUG, - "%s, flex stream send, size %lu bytes, not supported, ignoring", + "%s, flex stream send, size %u bytes, not supported, ignoring", __FUNCTION__, packet->m_nBodySize); break; case RTMP_PACKET_TYPE_FLEX_SHARED_OBJECT: /* flex shared object */ RTMP_Log(RTMP_LOGDEBUG, - "%s, flex shared object, size %lu bytes, not supported, ignoring", + "%s, flex shared object, size %u bytes, not supported, ignoring", __FUNCTION__, packet->m_nBodySize); break; @@ -1176,7 +1176,7 @@ /* flex message */ { RTMP_Log(RTMP_LOGDEBUG, - "%s, flex message, size %lu bytes, not fully supported", + "%s, flex message, size %u bytes, not fully supported", __FUNCTION__, packet->m_nBodySize); /*RTMP_LogHex(packet.m_body, packet.m_nBodySize); */ @@ -1198,7 +1198,7 @@ } case RTMP_PACKET_TYPE_INFO: /* metadata (notify) */ - RTMP_Log(RTMP_LOGDEBUG, "%s, received: notify %lu bytes", __FUNCTION__, + RTMP_Log(RTMP_LOGDEBUG, "%s, received: notify %u bytes", __FUNCTION__, packet->m_nBodySize); if (HandleMetadata(r, packet->m_body, packet->m_nBodySize)) bHasMediaPacket = 1; @@ -1211,7 +1211,7 @@ case RTMP_PACKET_TYPE_INVOKE: /* invoke */ - RTMP_Log(RTMP_LOGDEBUG, "%s, received: invoke %lu bytes", __FUNCTION__, + RTMP_Log(RTMP_LOGDEBUG, "%s, received: invoke %u bytes", __FUNCTION__, packet->m_nBodySize); /*RTMP_LogHex(packet.m_body, packet.m_nBodySize); */ @@ -1337,7 +1337,7 @@ nBytes = nRead; r->m_nBytesIn += nRead; if (r->m_bSendCounter - && r->m_nBytesIn > r->m_nBytesInSent + r->m_nClientBW / 2) + && r->m_nBytesIn > ( r->m_nBytesInSent + r->m_nClientBW / 10)) if (!SendBytesReceived(r)) return FALSE; } @@ -2339,7 +2339,7 @@ { AMFObject obj; AVal method; - int txn; + double txn; int ret = 0, nRes; if (body[0] != 0x02) /* make sure it is a string method name we start with */ { @@ -2357,7 +2357,7 @@ AMF_Dump(&obj); AMFProp_GetString(AMF_GetProp(&obj, NULL, 0), &method); - txn = (int)AMFProp_GetNumber(AMF_GetProp(&obj, NULL, 1)); + txn = AMFProp_GetNumber(AMF_GetProp(&obj, NULL, 1)); RTMP_Log(RTMP_LOGDEBUG, "%s, server invoking <%s>", __FUNCTION__, method.av_val); if (AVMATCH(&method, &av__result)) @@ -2366,14 +2366,14 @@ int i; for (i=0; i<r->m_numCalls; i++) { - if (r->m_methodCalls[i].num == txn) { + if (r->m_methodCalls[i].num == (int)txn) { methodInvoked = r->m_methodCalls[i].name; AV_erase(r->m_methodCalls, &r->m_numCalls, i, FALSE); break; } } if (!methodInvoked.av_val) { - RTMP_Log(RTMP_LOGDEBUG, "%s, received result id %d without matching request", + RTMP_Log(RTMP_LOGDEBUG, "%s, received result id %f without matching request", __FUNCTION__, txn); goto leave; } @@ -2584,7 +2584,7 @@ if (AVMATCH(&prop->p_name, name)) { - *p = *prop; + memcpy(p, prop, sizeof(*prop)); return TRUE; } @@ -2610,7 +2610,7 @@ if (prop->p_name.av_len > name->av_len && !memcmp(prop->p_name.av_val, name->av_val, name->av_len)) { - *p = *prop; + memcpy(p, prop, sizeof(*prop)); return TRUE; } @@ -3055,7 +3055,7 @@ if (ReadN(r, packet->m_body + packet->m_nBytesRead, nChunk) != nChunk) { - RTMP_Log(RTMP_LOGERROR, "%s, failed to read RTMP packet body. len: %lu", + RTMP_Log(RTMP_LOGERROR, "%s, failed to read RTMP packet body. len: %u", __FUNCTION__, packet->m_nBodySize); return FALSE; } @@ -4176,7 +4176,7 @@ if (pos + 11 + dataSize > nPacketLen) { RTMP_Log(RTMP_LOGERROR, - "Wrong data size (%lu), stream corrupted, aborting!", + "Wrong data size (%u), stream corrupted, aborting!", dataSize); ret = RTMP_READ_ERROR; break;
View file
rtmpdump-2.3.99.git20110728.tar.bz2/librtmp/rtmp_sys.h -> rtmpdump-2.3.99.git20111114.tar.bz2/librtmp/rtmp_sys.h
Changed
@@ -46,10 +46,10 @@ #include <sys/socket.h> #include <sys/times.h> #include <netdb.h> -#include <arpa/inet.h> #include <unistd.h> #include <netinet/in.h> #include <netinet/tcp.h> +#include <arpa/inet.h> #define GetSockError() errno #define SetSockError(e) errno = e #undef closesocket @@ -71,7 +71,8 @@ #define TLS_CTX tls_ctx * #define TLS_client(ctx,s) s = malloc(sizeof(ssl_context)); ssl_init(s);\ ssl_set_endpoint(s, SSL_IS_CLIENT); ssl_set_authmode(s, SSL_VERIFY_NONE);\ - ssl_set_rng(s, havege_rand, &ctx->hs); ssl_set_ciphers(s, ssl_default_ciphers);\ + ssl_set_rng(s, havege_rand, &ctx->hs);\ + ssl_set_ciphersuites(s, ssl_default_ciphersuites);\ ssl_set_session(s, 1, 600, &ctx->ssn) #define TLS_setfd(s,fd) ssl_set_bio(s, net_recv, &fd, net_send, &fd) #define TLS_connect(s) ssl_handshake(s)
View file
rtmpdump-2.3.99.git20110728.tar.bz2/rtmpdump.c -> rtmpdump-2.3.99.git20111114.tar.bz2/rtmpdump.c
Changed
@@ -46,6 +46,7 @@ #define RD_SUCCESS 0 #define RD_FAILED 1 #define RD_INCOMPLETE 2 +#define RD_NO_CONNECT 3 #define DEF_TIMEOUT 30 /* seconds */ #define DEF_BUFTIME (10 * 60 * 60 * 1000) /* 10 hours default */ @@ -685,7 +686,7 @@ RTMP_LogPrintf ("--resume|-e Resume a partial RTMP download\n"); RTMP_LogPrintf - ("--timeout|-m num Timeout connection num seconds (default: %lu)\n", + ("--timeout|-m num Timeout connection num seconds (default: %u)\n", DEF_TIMEOUT); RTMP_LogPrintf ("--start|-A num Start at num seconds into stream (not valid when using --live)\n"); @@ -698,7 +699,7 @@ RTMP_LogPrintf ("--hashes|-# Display progress with hashes, not with the byte counter\n"); RTMP_LogPrintf - ("--buffer|-b Buffer time in milliseconds (default: %lu)\n", + ("--buffer|-b Buffer time in milliseconds (default: %u)\n", DEF_BUFTIME); RTMP_LogPrintf ("--skip|-k num Skip num keyframes when looking for last keyframe to resume from. Useful if resume fails (default: %d)\n\n", @@ -1151,13 +1152,14 @@ if (tcUrl.av_len == 0) { - char str[512] = { 0 }; - - tcUrl.av_len = snprintf(str, 511, "%s://%.*s:%d/%.*s", + tcUrl.av_len = strlen(RTMPProtocolStringsLower[protocol]) + + hostname.av_len + app.av_len + sizeof("://:65535/"); + tcUrl.av_val = (char *) malloc(tcUrl.av_len); + if (!tcUrl.av_val) + return RD_FAILED; + tcUrl.av_len = snprintf(tcUrl.av_val, tcUrl.av_len, "%s://%.*s:%d/%.*s", RTMPProtocolStringsLower[protocol], hostname.av_len, hostname.av_val, port, app.av_len, app.av_val); - tcUrl.av_val = (char *) malloc(tcUrl.av_len + 1); - strcpy(tcUrl.av_val, str); } int first = 1; @@ -1253,7 +1255,7 @@ if (!RTMP_Connect(&rtmp, NULL)) { - nStatus = RD_FAILED; + nStatus = RD_NO_CONNECT; break; }
View file
rtmpdump-2.3.99.git20110728.tar.bz2/rtmpgw.c -> rtmpdump-2.3.99.git20111114.tar.bz2/rtmpgw.c
Changed
@@ -563,7 +563,7 @@ rtmp.Link.token = req.token; rtmp.m_read.timestamp = dSeek; - RTMP_LogPrintf("Connecting ... port: %d, app: %s\n", req.rtmpport, req.app); + RTMP_LogPrintf("Connecting ... port: %d, app: %s\n", req.rtmpport, req.app.av_val); if (!RTMP_Connect(&rtmp, NULL)) { RTMP_LogPrintf("%s, failed to connect!\n", __FUNCTION__); @@ -738,7 +738,7 @@ if (closesocket(server->socket)) RTMP_Log(RTMP_LOGERROR, "%s: Failed to close listening socket, error %d", - GetSockError()); + __FUNCTION__, GetSockError()); server->state = STREAMING_STOPPED; } @@ -1103,7 +1103,7 @@ RTMP_LogPrintf ("--jtv|-j JSON Authentication token for Justin.tv legacy servers\n"); RTMP_LogPrintf - ("--buffer|-b Buffer time in milliseconds (default: %lu)\n\n", + ("--buffer|-b Buffer time in milliseconds (default: %u)\n\n", defaultRTMPRequest.bufferTime); RTMP_LogPrintf
View file
rtmpdump-2.3.99.git20110728.tar.bz2/rtmpsrv.c -> rtmpdump-2.3.99.git20111114.tar.bz2/rtmpsrv.c
Changed
@@ -1,6 +1,6 @@ /* Simple RTMP Server * Copyright (C) 2009 Andrej Stepanchuk - * Copyright (C) 2009 Howard Chu + * Copyright (C) 2009-2011 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 @@ -95,6 +95,10 @@ STREAMING_SERVER *startStreaming(const char *address, int port); void stopStreaming(STREAMING_SERVER * server); +void AVreplace(AVal *src, const AVal *orig, const AVal *repl); + +static const AVal av_dquote = AVC("\""); +static const AVal av_escdquote = AVC("\\\""); typedef struct { @@ -261,6 +265,7 @@ static const AVal av_Stopped_playing = AVC("Stopped playing"); SAVC(details); SAVC(clientid); +static const AVal av_NetStream_Authenticate_UsherToken = AVC("NetStream.Authenticate.UsherToken"); static int SendPlayStart(RTMP *r) @@ -575,6 +580,15 @@ { SendResultNumber(r, txn, 10.0); } + else if (AVMATCH(&method, &av_NetStream_Authenticate_UsherToken)) + { + AVal usherToken; + AMFProp_GetString(AMF_GetProp(&obj, NULL, 3), &usherToken); + AVreplace(&usherToken, &av_dquote, &av_escdquote); + server->arglen += 6 + usherToken.av_len; + server->argc += 2; + r->Link.usherToken = usherToken; + } else if (AVMATCH(&method, &av_play)) { char *file, *p, *q, *cmd, *ptr; @@ -640,6 +654,17 @@ ptr += sprintf(ptr, " -p \"%s\"", r->Link.pageUrl.av_val); argv[argc++].av_len = r->Link.pageUrl.av_len; } + if (r->Link.usherToken.av_val) + { + argv[argc].av_val = ptr + 1; + argv[argc++].av_len = 2; + argv[argc].av_val = ptr + 5; + ptr += sprintf(ptr, " -j \"%s\"", r->Link.usherToken.av_val); + argv[argc++].av_len = r->Link.usherToken.av_len; + free(r->Link.usherToken.av_val); + r->Link.usherToken.av_val = NULL; + r->Link.usherToken.av_len = 0; + } if (r->Link.extras.o_num) { ptr = dumpAMF(&r->Link.extras, ptr, argv, &argc); AMF_Reset(&r->Link.extras); @@ -740,7 +765,7 @@ { int ret = 0; - RTMP_Log(RTMP_LOGDEBUG, "%s, received packet type %02X, size %lu bytes", __FUNCTION__, + RTMP_Log(RTMP_LOGDEBUG, "%s, received packet type %02X, size %u bytes", __FUNCTION__, packet->m_packetType, packet->m_nBodySize); switch (packet->m_packetType) @@ -787,7 +812,7 @@ case 0x11: // flex message { - RTMP_Log(RTMP_LOGDEBUG, "%s, flex message, size %lu bytes, not fully supported", + RTMP_Log(RTMP_LOGDEBUG, "%s, flex message, size %u bytes, not fully supported", __FUNCTION__, packet->m_nBodySize); //RTMP_LogHex(packet.m_body, packet.m_nBodySize); @@ -815,7 +840,7 @@ case 0x14: // invoke - RTMP_Log(RTMP_LOGDEBUG, "%s, received: invoke %lu bytes", __FUNCTION__, + RTMP_Log(RTMP_LOGDEBUG, "%s, received: invoke %u bytes", __FUNCTION__, packet->m_nBodySize); //RTMP_LogHex(packet.m_body, packet.m_nBodySize); @@ -911,6 +936,11 @@ rtmp.Link.pageUrl.av_val = NULL; rtmp.Link.app.av_val = NULL; rtmp.Link.flashVer.av_val = NULL; + if (rtmp.Link.usherToken.av_val) + { + free(rtmp.Link.usherToken.av_val); + rtmp.Link.usherToken.av_val = NULL; + } RTMP_LogPrintf("done!\n\n"); quit: @@ -1023,7 +1053,7 @@ if (closesocket(server->socket)) RTMP_Log(RTMP_LOGERROR, "%s: Failed to close listening socket, error %d", - GetSockError()); + __FUNCTION__, GetSockError()); server->state = STREAMING_STOPPED; } @@ -1111,3 +1141,43 @@ #endif return nStatus; } + +void +AVreplace(AVal *src, const AVal *orig, const AVal *repl) +{ + char *srcbeg = src->av_val; + char *srcend = src->av_val + src->av_len; + char *dest, *sptr, *dptr; + int n = 0; + + /* count occurrences of orig in src */ + sptr = src->av_val; + while (sptr < srcend && (sptr = strstr(sptr, orig->av_val))) + { + n++; + sptr += orig->av_len; + } + if (!n) + return; + + dest = malloc(src->av_len + 1 + (repl->av_len - orig->av_len) * n); + + sptr = src->av_val; + dptr = dest; + while (sptr < srcend && (sptr = strstr(sptr, orig->av_val))) + { + n = sptr - srcbeg; + memcpy(dptr, srcbeg, n); + dptr += n; + memcpy(dptr, repl->av_val, repl->av_len); + dptr += repl->av_len; + sptr += orig->av_len; + srcbeg = sptr; + } + n = srcend - srcbeg; + memcpy(dptr, srcbeg, n); + dptr += n; + *dptr = '\0'; + src->av_val = dest; + src->av_len = dptr - dest; +}
View file
rtmpdump-2.3.99.git20110728.tar.bz2/rtmpsuck.c -> rtmpdump-2.3.99.git20111114.tar.bz2/rtmpsuck.c
Changed
@@ -456,7 +456,7 @@ { int ret = 0; - RTMP_Log(RTMP_LOGDEBUG, "%s, %s sent packet type %02X, size %lu bytes", __FUNCTION__, + RTMP_Log(RTMP_LOGDEBUG, "%s, %s sent packet type %02X, size %u bytes", __FUNCTION__, cst[which], packet->m_packetType, packet->m_nBodySize); switch (packet->m_packetType) @@ -649,7 +649,7 @@ if (pos + 11 + dataSize > nPacketLen) { RTMP_Log(RTMP_LOGERROR, - "Wrong data size (%lu), stream corrupted, aborting!", + "Wrong data size (%u), stream corrupted, aborting!", dataSize); ret = -2; break; @@ -1117,7 +1117,7 @@ if (fd && closesocket(fd)) RTMP_Log(RTMP_LOGERROR, "%s: Failed to close listening socket, error %d", - GetSockError()); + __FUNCTION__, GetSockError()); server->state = STREAMING_STOPPED; }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.