]> granicus.if.org Git - rtmpdump/commitdiff
Support decoding AMF_XML_DOC
authorAntti Ajanki <antti.ajanki@iki.fi>
Fri, 23 Dec 2011 01:54:10 +0000 (17:54 -0800)
committerHoward Chu <hyc@highlandsun.com>
Fri, 23 Dec 2011 01:54:10 +0000 (17:54 -0800)
MF_XML_DOC data is an XML document which is encoded similarly to a
long string.

librtmp/amf.c

index f9ecf216c95a07f88535c6fa541789f2c85f5596..659421e557a933d0bbc572a24c0de25abe70be5f 100644 (file)
@@ -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!");