[rtmpdump] [PATCH] Support decoding AMF_XML_DOC

Antti Ajanki antti.ajanki at iki.fi
Thu Dec 22 21:22:26 CET 2011


AMF_XML_DOC data is an XML document which is encoded similarly to a
long string.
---
 librtmp/amf.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/librtmp/amf.c b/librtmp/amf.c
index f9ecf21..659421e 100644
--- a/librtmp/amf.c
+++ b/librtmp/amf.c
@@ -735,13 +735,15 @@ AMFProp_Decode(AMFObjectProperty *prop, const char *pBuffer, int nSize,
 	break;
       }
     case AMF_LONG_STRING:
+    case AMF_XML_DOC:
       {
 	unsigned int nStringSize = AMF_DecodeInt32(pBuffer);
 	if (nSize < (long)nStringSize + 4)
 	  return -1;
 	AMF_DecodeLongString(pBuffer, &prop->p_vu.p_aval);
 	nSize -= (4 + nStringSize);
-	prop->p_type = AMF_STRING;
+	if (prop->p_type == AMF_LONG_STRING)
+	  prop->p_type = AMF_STRING;
 	break;
       }
     case AMF_RECORDSET:
@@ -750,12 +752,6 @@ AMFProp_Decode(AMFObjectProperty *prop, const char *pBuffer, int nSize,
 	return -1;
 	break;
       }
-    case AMF_XML_DOC:
-      {
-	RTMP_Log(RTMP_LOGERROR, "AMF_XML_DOC not supported!");
-	return -1;
-	break;
-      }
     case AMF_TYPED_OBJECT:
       {
 	RTMP_Log(RTMP_LOGERROR, "AMF_TYPED_OBJECT not supported!");
-- 
1.7.7.3



More information about the rtmpdump mailing list