gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r9918: parse the Elements correctly f


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9918: parse the Elements correctly for the first message.
Date: Sat, 27 Dec 2008 19:44:43 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9918
committer: address@hidden
branch nick: rtmp
timestamp: Sat 2008-12-27 19:44:43 -0700
message:
  parse the Elements correctly for the first message.
modified:
  libnet/rtmp.cpp
=== modified file 'libnet/rtmp.cpp'
--- a/libnet/rtmp.cpp   2008-12-28 01:44:57 +0000
+++ b/libnet/rtmp.cpp   2008-12-28 02:44:43 +0000
@@ -616,7 +616,7 @@
     // The first data object is the method name of this object.
     boost::shared_ptr<amf::Element> name = amf_obj.extractAMF(ptr, tooFar);
     if (name) {
-       ptr += name->getDataSize() + 3; // skip the length bytes too
+       ptr += name->getDataSize() + AMF_HEADER_SIZE; // skip the length bytes 
too
     } else {
        log_error("Name field of RTMP Message corrupted!");
        return 0;
@@ -629,7 +629,7 @@
        // Most onStatus messages have the stream ID, but the Data Start 
onStatus
        // message is basically just a marker that an FLV file is coming next.
        if (streamid->getType() == Element::NUMBER_AMF0) {
-           ptr += streamid->getDataSize() + 2;
+           ptr += AMF0_NUMBER_SIZE + 1;
        }
     } else {
        log_error("Stream ID field of RTMP Message corrupted!");
@@ -659,12 +659,12 @@
         if (el == 0) {
            break;
        }
-//     el->dump();
+       el->dump();
        msg->addObject(el);
        if (status) {
            msg->checkStatus(el);
        }
-    };    
+    };
     
     return msg;
 }
@@ -673,7 +673,7 @@
 RTMP::decodeMsgBody(amf::Buffer &buf)
 {
 //    GNASH_REPORT_FUNCTION;
-    return decodeMsgBody(buf.reference(), buf.size());
+    return decodeMsgBody(buf.reference(), buf.allocated());
 }
 
 boost::shared_ptr<amf::Buffer> 


reply via email to

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