Commit b47f3c9c authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

rtpmp4gdepay: don't spam debug log for broken ADTS-in-RTP AAC

Print warning only once.
parent 32c465a5
......@@ -241,6 +241,7 @@ gst_rtp_mp4g_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
"mpegversion", G_TYPE_INT, 4, "stream-format", G_TYPE_STRING, "raw",
NULL);
rtpmp4gdepay->check_adts = TRUE;
rtpmp4gdepay->warn_adts = TRUE;
} else if (strcmp (str, "video") == 0) {
srccaps = gst_caps_new_simple ("video/mpeg",
"mpegversion", G_TYPE_INT, 4,
......@@ -681,13 +682,17 @@ gst_rtp_mp4g_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
0xfffe0000, 0xfff00000, 0, 4, &v) == 0) {
guint adts_hdr_len = (((v >> 16) & 0x1) == 0) ? 9 : 7;
if (avail > adts_hdr_len) {
GST_WARNING_OBJECT (rtpmp4gdepay, "Detected ADTS header of "
"%u bytes, skipping", adts_hdr_len);
if (rtpmp4gdepay->warn_adts) {
GST_WARNING_OBJECT (rtpmp4gdepay, "Detected ADTS header of "
"%u bytes, skipping", adts_hdr_len);
rtpmp4gdepay->warn_adts = FALSE;
}
gst_adapter_flush (rtpmp4gdepay->adapter, adts_hdr_len);
avail -= adts_hdr_len;
}
} else {
rtpmp4gdepay->check_adts = FALSE;
rtpmp4gdepay->warn_adts = TRUE;
}
}
......
......@@ -68,6 +68,7 @@ struct _GstRtpMP4GDepay
guint prev_AU_num;
gboolean check_adts; /* check for ADTS headers */
gboolean warn_adts; /* warn about ADTS headers */
GQueue *packets;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment