[rtmpdump] [PATCH] Print status at RTMP_LOGINFO level
Stream Alerts Support
support at streamalerts.com
Tue Aug 24 20:00:33 CEST 2010
Hello, I wanted to be able to dump status codes to stdout without having to
set the logging level to Debug and get all of the extra info. Here's a
simple patch to print the status code and description returned from the
servers at the Info level so you can get a quick idea of what's going on.
Let me know what ya'll think, thanks!
Index: amf.c
===================================================================
--- amf.c (revision 548)
+++ amf.c (working copy)
@@ -1145,11 +1145,21 @@
AMF_Dump(AMFObject *obj)
{
int n;
+ char str[1024] = "";
RTMP_Log(RTMP_LOGDEBUG, "(object begin)");
for (n = 0; n < obj->o_num; n++)
{
AMFProp_Dump(&obj->o_props[n]);
+ if (obj->o_props[n].p_name.av_len &&
strncmp(obj->o_props[n].p_name.av_val, "code", 4) == 0 &&
+ obj->o_props[n].p_type == AMF_STRING)
+ snprintf(str, 1024, "%s", obj->o_props[n].p_vu.p_aval.av_val);
+ if (obj->o_props[n].p_name.av_len &&
strncmp(obj->o_props[n].p_name.av_val, "description", 11) == 0 &&
+ obj->o_props[n].p_type == AMF_STRING)
+ snprintf(str, 1024, "%s: %s", str,
obj->o_props[n].p_vu.p_aval.av_val);
}
+ // dump status at info level
+ if (strlen(str) > 1 && RTMP_LogGetLevel() <= RTMP_LOGINFO)
+ RTMP_Log(RTMP_LOGINFO, str);
RTMP_Log(RTMP_LOGDEBUG, "(object end)");
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mplayerhq.hu/pipermail/rtmpdump/attachments/20100824/0d840277/attachment.htm>
More information about the rtmpdump
mailing list