mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 02:15:31 +00:00
rtpmp4gdepay: don't spam debug log for broken ADTS-in-RTP AAC
Print warning only once.
This commit is contained in:
parent
32c465a537
commit
b47f3c9c50
2 changed files with 8 additions and 2 deletions
|
@ -241,6 +241,7 @@ gst_rtp_mp4g_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
|
||||||
"mpegversion", G_TYPE_INT, 4, "stream-format", G_TYPE_STRING, "raw",
|
"mpegversion", G_TYPE_INT, 4, "stream-format", G_TYPE_STRING, "raw",
|
||||||
NULL);
|
NULL);
|
||||||
rtpmp4gdepay->check_adts = TRUE;
|
rtpmp4gdepay->check_adts = TRUE;
|
||||||
|
rtpmp4gdepay->warn_adts = TRUE;
|
||||||
} else if (strcmp (str, "video") == 0) {
|
} else if (strcmp (str, "video") == 0) {
|
||||||
srccaps = gst_caps_new_simple ("video/mpeg",
|
srccaps = gst_caps_new_simple ("video/mpeg",
|
||||||
"mpegversion", G_TYPE_INT, 4,
|
"mpegversion", G_TYPE_INT, 4,
|
||||||
|
@ -681,13 +682,17 @@ gst_rtp_mp4g_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
|
||||||
0xfffe0000, 0xfff00000, 0, 4, &v) == 0) {
|
0xfffe0000, 0xfff00000, 0, 4, &v) == 0) {
|
||||||
guint adts_hdr_len = (((v >> 16) & 0x1) == 0) ? 9 : 7;
|
guint adts_hdr_len = (((v >> 16) & 0x1) == 0) ? 9 : 7;
|
||||||
if (avail > adts_hdr_len) {
|
if (avail > adts_hdr_len) {
|
||||||
|
if (rtpmp4gdepay->warn_adts) {
|
||||||
GST_WARNING_OBJECT (rtpmp4gdepay, "Detected ADTS header of "
|
GST_WARNING_OBJECT (rtpmp4gdepay, "Detected ADTS header of "
|
||||||
"%u bytes, skipping", adts_hdr_len);
|
"%u bytes, skipping", adts_hdr_len);
|
||||||
|
rtpmp4gdepay->warn_adts = FALSE;
|
||||||
|
}
|
||||||
gst_adapter_flush (rtpmp4gdepay->adapter, adts_hdr_len);
|
gst_adapter_flush (rtpmp4gdepay->adapter, adts_hdr_len);
|
||||||
avail -= adts_hdr_len;
|
avail -= adts_hdr_len;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
rtpmp4gdepay->check_adts = FALSE;
|
rtpmp4gdepay->check_adts = FALSE;
|
||||||
|
rtpmp4gdepay->warn_adts = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,7 @@ struct _GstRtpMP4GDepay
|
||||||
guint prev_AU_num;
|
guint prev_AU_num;
|
||||||
|
|
||||||
gboolean check_adts; /* check for ADTS headers */
|
gboolean check_adts; /* check for ADTS headers */
|
||||||
|
gboolean warn_adts; /* warn about ADTS headers */
|
||||||
|
|
||||||
GQueue *packets;
|
GQueue *packets;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue