gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/rtmp r9966: process an ECMA array's like a


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9966: process an ECMA array's like an Object with terminator bytes.
Date: Wed, 04 Feb 2009 14:17:43 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9966
committer: address@hidden
branch nick: rtmp
timestamp: Wed 2009-02-04 14:17:43 -0700
message:
  process an ECMA array's like an Object with terminator bytes.
modified:
  libamf/amf.cpp
  libamf/amf.h
=== modified file 'libamf/amf.cpp'
--- a/libamf/amf.cpp    2009-01-05 05:24:52 +0000
+++ b/libamf/amf.cpp    2009-02-04 21:17:43 +0000
@@ -895,7 +895,7 @@
         return el;
     }
 
-    std::map<boost::uint16_t, amf::Element &> references;
+    std::map<boost::uint16_t, amf::Element> references;
     
     // All elements look like this:
     // the first two bytes is the length of name of the element
@@ -993,6 +993,27 @@
       case Element::ECMA_ARRAY_AMF0:
       {
          el->makeECMAArray();
+         tmpptr += sizeof(boost::uint32_t);
+#if 1
+         while (tmpptr < tooFar) { // FIXME: was tooFar - AMF_HEADER_SIZE)
+             if (*tmpptr+3 == TERMINATOR) {
+//               log_debug("No data associated with Property in object");
+                 tmpptr++;
+                 break;
+             }
+             boost::shared_ptr<amf::Element> child = 
amf_obj.extractProperty(tmpptr, tooFar); 
+             if (child == 0) {
+                 // skip past zero length string (2 bytes), null (1 byte) and 
end object (1 byte)
+//               tmpptr += 3;
+                 break;
+             }
+//           child->dump();
+             el->addProperty(child);
+             tmpptr += amf_obj.totalsize();
+         };
+         tmpptr += AMF_HEADER_SIZE;            // skip past the terminator 
bytes
+         break;
+#else
          // get the number of elements in the array
          boost::uint32_t items = ntohl((*(boost::uint32_t *)tmpptr) & 
0xffffffff);
          tmpptr += sizeof(boost::uint32_t);
@@ -1006,6 +1027,7 @@
              tmpptr += amf_obj.totalsize();
          };
          tmpptr += AMF_HEADER_SIZE;            // skip past the terminator 
bytes
+#endif
          break;
       }
       case Element::OBJECT_END_AMF0:

=== modified file 'libamf/amf.h'
--- a/libamf/amf.h      2009-02-03 17:43:02 +0000
+++ b/libamf/amf.h      2009-02-04 21:17:43 +0000
@@ -74,7 +74,7 @@
 
 /// Binary representation of an ActionScript object.
 //
-/// AMF is used to send objects, wheather to a SharedObject .sol file,
+/// AMF is used to send objects, whether to a SharedObject .sol file,
 /// a memory based LocalConnection segment, or over an RTMP connection
 /// for streaming.
 ///


reply via email to

[Prev in Thread] Current Thread [Next in Thread]