mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 08:17:01 +00:00
Always add PPS to the sprop-parameters-set
Rework the parsing code that under certain circumstances dropped the PPS from the sprop-parameters-set. Fixes #572854.
This commit is contained in:
parent
b9adb5846b
commit
aeee52be05
1 changed files with 52 additions and 70 deletions
|
@ -467,23 +467,15 @@ gst_rtp_h264_pay_decode_nal (GstRtpH264Pay * payloader,
|
||||||
{
|
{
|
||||||
guint8 *sps = NULL, *pps = NULL;
|
guint8 *sps = NULL, *pps = NULL;
|
||||||
guint sps_len = 0, pps_len = 0;
|
guint sps_len = 0, pps_len = 0;
|
||||||
|
guint8 header, type;
|
||||||
|
guint len;
|
||||||
|
|
||||||
/* default is no update */
|
/* default is no update */
|
||||||
*updated = FALSE;
|
*updated = FALSE;
|
||||||
|
|
||||||
if (size <= 3) {
|
|
||||||
GST_WARNING ("Encoded buffer len %u <= 3", size);
|
|
||||||
} else {
|
|
||||||
GST_DEBUG ("NAL payload len=%u", size);
|
GST_DEBUG ("NAL payload len=%u", size);
|
||||||
|
|
||||||
/* loop through all NAL units and save the locations of any
|
len = size;
|
||||||
* SPS / PPS for later processing. Only the last seen SPS
|
|
||||||
* or PPS will be considered */
|
|
||||||
while (size > 5) {
|
|
||||||
guint8 header, type;
|
|
||||||
guint len;
|
|
||||||
|
|
||||||
len = next_start_code (data, size);
|
|
||||||
header = data[0];
|
header = data[0];
|
||||||
type = header & 0x1f;
|
type = header & 0x1f;
|
||||||
|
|
||||||
|
@ -508,15 +500,6 @@ gst_rtp_h264_pay_decode_nal (GstRtpH264Pay * payloader,
|
||||||
(header >> 5) & 3, type, len);
|
(header >> 5) & 3, type, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* end of loop */
|
|
||||||
if (len >= size - 4) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* next NAL start */
|
|
||||||
data += len + 4;
|
|
||||||
size -= len + 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If we encountered an SPS and/or a PPS, check if it's the
|
/* If we encountered an SPS and/or a PPS, check if it's the
|
||||||
* same as the one we have. If not, update our version and
|
* same as the one we have. If not, update our version and
|
||||||
|
@ -552,7 +535,6 @@ gst_rtp_h264_pay_decode_nal (GstRtpH264Pay * payloader,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_rtp_h264_pay_parse_sps_pps (GstBaseRTPPayload * basepayload,
|
gst_rtp_h264_pay_parse_sps_pps (GstBaseRTPPayload * basepayload,
|
||||||
|
|
Loading…
Reference in a new issue