On Thu Aug 7 03:03:32 2025 +0000, Elizabeth Figura wrote:
I see. While the workaround may make sense, I don't think we should commit workarounds until we fully understand the bug. Of course, in a sense we're only limiting an existing workaround, so it's probably still a good idea...
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 twos buffers before calling drain. They are: 1. an AU; and 2. 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): ``` 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.