View Single Post
Old 11-02-2015, 02:24 PM
passel's Avatar
passel passel is offline
Sinecure Expert

Super Moderator
* Guru *
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,031

RTMP uses doubles for identifying a number of things (e.g. audioCodec, videoCodec, videoFunction etc...).
I don't know anything about RTMP, really, but looking at the sequence of bytes after id
40 E7 92 00 00 00 00 00 00 00
looked like a Big Endian Double format (a lot of Doubles holding integer values will start with exponent 40 xx ...).
Sure enough, if you byte swap the eight bytes into a double and display it in VB, the value is 48272, which is the number you passed to the server.

Since you gave the server the number that it is passing back to you, I don't see that you're getting a lot of additional information at this point, just in a different format (ASCII in, Big Endian Double out).
A quick, hardcoded, conversion as proof
Option Explicit
  Private Type dblBytesType
    b(7) As Byte
  End Type
  Private Type dblType
    d As Double
  End Type
Private Sub Command1_Click()
  Dim b As dblBytesType
  Dim d As dblType
  With b
    .b(7) = &H40 'reversing the bytes, going from BigEndian to LittleEndian order
    .b(6) = &HE7
    .b(5) = &H92
  End With
  LSet d = b       'Copy the eight bytes from the byte array into a Double
  Debug.Print d.d  'Print the double value out in the "debug" window.
End Sub
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.

Last edited by passel; 11-02-2015 at 04:50 PM.
Reply With Quote