On Thu Aug 7 05:03:43 2025 +0000, Brendan McGrath wrote:
I think I've got to the bottom of this one now. It appears to be the result of a bug in `h264parse`. Our test only provides two buffers before calling drain. They are:
- an AU; and
- an SPS
The drain creates a `SEGMENT_DONE` event which causes `h264parse` to call `gst_h264_parse_update_src_caps`. In there it calls `gst_h264_parse_make_codec_data` to create the `codec_data` (which is required for AVC) but it fails due to the missing PPS (which has not yet been sent):
h264parse gsth264parse.c:1666:gst_h264_parse_make_codec_data:<h264parse1> constructing codec_data: num_sps=1, num_pps=0
But it never handles this failure correctly, as it then only checks for the absence of SPS (gsth264parse.c:2154 @ tag 1.24.2, or [main branch](https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/subprojects/g...)):
caps = NULL; if (G_UNLIKELY (!sps)) { caps = gst_caps_copy (sink_caps); } else {
Simply modifying that if statement to also check for the absence of pps fixes the issue. I'll report this upstream, but I suspect our test case has hit rather an edge case here.
Oops. I was about to report this upstream and found it has already been fixed with: [ffed473](https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/ffed473992e9a66d...)