h264parse: Never output stream-format=avc/avc3 caps without codec_data

It's not possible to interpret further buffers without knowing the nal_length_size
field, so avc1/avc3 caps without the codec_data aren't valid, don't push them out.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8955>
This commit is contained in:
Olivier Crête 2025-05-08 19:16:13 -04:00
parent 38499c949d
commit ffed473992

View File

@ -2186,6 +2186,14 @@ gst_h264_parse_update_src_caps (GstH264Parse * h264parse, GstCaps * caps)
buf = gst_buffer_ref (h264parse->codec_data_in);
modified = TRUE;
}
/* In AVC or AVC3, we can't issue caps without a codec_data */
if (buf == NULL) {
GST_DEBUG_OBJECT (h264parse, "Couldn't construct codec_data, not yet"
" ready to send out src caps for AVC stream");
gst_caps_unref (sink_caps);
return;
}
}
caps = NULL;