-
Notifications
You must be signed in to change notification settings - Fork 1
/
librtmp.patch
74 lines (69 loc) · 1.84 KB
/
librtmp.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Index: librtmp/log.c
===================================================================
--- librtmp/log.c (revision 195)
+++ librtmp/log.c (working copy)
@@ -49,6 +49,15 @@
{
char str[MAX_PRINT_LEN]="";
+#ifdef _DEBUG
+ if (!fmsg) {
+ fmsg = fopen("C:\\Temp\\RTMP.log", "w");
+ RTMP_debuglevel = RTMP_LOGDEBUG2;
+ }
+#else
+ return;
+#endif
+
vsnprintf(str, MAX_PRINT_LEN-1, format, vl);
/* Filter out 'no-name' */
Index: librtmp/rtmp.c
===================================================================
--- librtmp/rtmp.c (revision 195)
+++ librtmp/rtmp.c (working copy)
@@ -1247,11 +1247,6 @@
return bHasMediaPacket;
}
-#ifdef _DEBUG
-extern FILE *netstackdump;
-extern FILE *netstackdump_read;
-#endif
-
static int
ReadN(RTMP *r, char *buffer, int n)
{
@@ -1319,9 +1314,6 @@
SendBytesReceived(r);
}
/*RTMP_Log(RTMP_LOGDEBUG, "%s: %d bytes\n", __FUNCTION__, nBytes); */
-#ifdef _DEBUG
- fwrite(ptr, 1, nBytes, netstackdump_read);
-#endif
if (nBytes == 0)
{
@@ -2634,6 +2634,16 @@
/* Show metadata */
RTMP_Log(RTMP_LOGINFO, "Metadata:");
DumpMetaData(&obj);
+
+ // added by disaster123 to always store the metadata
+ if ((r->m_read.nMetaHeaderSize != len) || (memcmp(r->m_read.metaHeader, body, r->m_read.nMetaHeaderSize) != 0)) {
+ if (r->m_read.metaHeader)
+ free(r->m_read.metaHeader);
+ r->m_read.metaHeader = (char *) malloc(len);
+ memcpy(r->m_read.metaHeader, body, len);
+ r->m_read.nMetaHeaderSize = len;
+ }
+
if (RTMP_FindFirstMatchingProperty(&obj, &av_duration, &prop))
{
r->m_fDuration = prop.p_vu.p_number;
@@ -3536,10 +3528,6 @@
{
int rc;
-#ifdef _DEBUG
- fwrite(buf, 1, len, netstackdump);
-#endif
-
#if defined(CRYPTO) && !defined(NO_SSL)
if (sb->sb_ssl)
{