From ff137a2059a336820202058620c0c6eee6a23761 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 10 Oct 2018 15:27:30 +0000 Subject: [PATCH] h265parse: Don't push NALs before we have HEADERS Otherwise we may endup pushing incomplete caps. Note that this has the side effect that caps are no longer pushed twice in presence of VUI with valid framerate. --- gst/videoparsers/gsth265parse.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c index 4b5ec7285f..26be12d390 100644 --- a/gst/videoparsers/gsth265parse.c +++ b/gst/videoparsers/gsth265parse.c @@ -1308,6 +1308,13 @@ gst_h265_parse_handle_frame (GstBaseParse * parse, goto skip; } + /* Do not push immediatly if we don't have all headers. This ensure that + * our caps are complete, avoiding a renegotiation */ + if (h265parse->align == GST_H265_PARSE_ALIGN_NAL && + !GST_H265_PARSE_STATE_VALID (h265parse, + GST_H265_PARSE_STATE_VALID_PICTURE_HEADERS)) + frame->flags |= GST_BASE_PARSE_FRAME_FLAG_QUEUE; + if (nonext) { /* If there is a marker flag, or input is AU, we know this is complete */ if (GST_BUFFER_FLAG_IS_SET (frame->buffer, GST_BUFFER_FLAG_MARKER) ||