rtph265depay; Fix handling of marker on aggregated packet
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Sun, 27 Jan 2019 02:02:27 +0000 (21:02 -0500)
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>
Thu, 31 Jan 2019 19:30:14 +0000 (19:30 +0000)
When multiple nals are aggrgated, the marker bit should be associated only
with the last NAL of the packet. Otherwise we may break rendering in with
AU alignment.

gst/rtp/gstrtph265depay.c

index f344a06..551e08a 100644 (file)
@@ -1363,6 +1363,7 @@ gst_rtp_h265_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
 #endif
 
         while (payload_len > 2) {
+          gboolean last = FALSE;
 
           nalu_size = (payload[0] << 8) | payload[1];
 
@@ -1389,8 +1390,11 @@ gst_rtp_h265_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
 
           gst_rtp_copy_video_meta (rtph265depay, outbuf, rtp->buffer);
 
+          if (payload_len - nalu_size <= 2)
+            last = TRUE;
+
           gst_rtp_h265_depay_handle_nal (rtph265depay, outbuf, timestamp,
-              marker);
+              marker && last);
 
           payload += nalu_size;
           payload_len -= nalu_size;