Bläddra i källkod

librtmp: Add missing extended timestamp in Type 3 chunks

According to https://rtmp.veriskope.com/docs/spec/#5313-extended-timestamp
extended timestamps need to be present in Type 3 chunks
(`RTMP_PACKET_SIZE_MINIMUM`) if the previous chunk also included an
extended timestamp
James Hurley 2 år sedan
förälder
incheckning
7fe5cb7dad
1 ändrade filer med 8 tillägg och 0 borttagningar
  1. 8 0
      plugins/obs-outputs/librtmp/rtmp.c

+ 8 - 0
plugins/obs-outputs/librtmp/rtmp.c

@@ -4250,6 +4250,7 @@ RTMP_SendPacket(RTMP *r, RTMPPacket *packet, int queue)
         buffer += nChunkSize;
         hSize = 0;
 
+        // prepare to send off remaining data in Type 3 chunks
         if (nSize > 0)
         {
             header = buffer - 1;
@@ -4259,6 +4260,11 @@ RTMP_SendPacket(RTMP *r, RTMPPacket *packet, int queue)
                 header -= cSize;
                 hSize += cSize;
             }
+            if (t >= 0xffffff)
+            {
+                hSize += 4;
+                header -= 4;
+            }
             *header = (0xc0 | c);
             if (cSize)
             {
@@ -4267,6 +4273,8 @@ RTMP_SendPacket(RTMP *r, RTMPPacket *packet, int queue)
                 if (cSize == 2)
                     header[2] = tmp >> 8;
             }
+            if (t >= 0xffffff)
+                AMF_EncodeInt32(header+hSize-4, header+hSize, t);
         }
     }
     if (tbuf)