summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Yang <seungha.yang@navercorp.com>2018-08-13 23:45:13 +0900
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2018-09-10 22:36:59 -0400
commit80cab68889696084be30970e93663abe915cbdc6 (patch)
tree03b50c756f8994cf335362b81b174b5863437dcd
parentababccbcb2ea3360cce69da8e069cfb414e64fd1 (diff)
h265parse: Fix collection of access units to preserve config headers
Apply the commit 7d44a51 See also https://bugzilla.gnome.org/show_bug.cgi?id=732203 https://bugzilla.gnome.org/show_bug.cgi?id=754124
-rw-r--r--gst/videoparsers/gsth265parse.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c
index 559572594..9b8c8f849 100644
--- a/gst/videoparsers/gsth265parse.c
+++ b/gst/videoparsers/gsth265parse.c
@@ -375,7 +375,8 @@ gst_h265_parse_negotiate (GstH265Parse * h265parse, gint in_format,
h265parse->format = format;
h265parse->align = align;
- h265parse->transform = (in_format != h265parse->format);
+ h265parse->transform = in_format != h265parse->format ||
+ align == GST_H265_PARSE_ALIGN_AU;
if (caps)
gst_caps_unref (caps);
@@ -1076,7 +1077,13 @@ out:
skip:
GST_DEBUG_OBJECT (h265parse, "skipping %d", *skipsize);
- gst_h265_parse_reset_frame (h265parse);
+ /* If we are collecting access units, we need to preserve the initial
+ * config headers (SPS, PPS et al.) and only reset the frame if another
+ * slice NAL was received. This means that broken pictures are discarded */
+ if (h265parse->align != GST_H265_PARSE_ALIGN_AU ||
+ !(h265parse->state & GST_H265_PARSE_STATE_VALID_PICTURE_HEADERS) ||
+ (h265parse->state & GST_H265_PARSE_STATE_GOT_SLICE))
+ gst_h265_parse_reset_frame (h265parse);
goto out;
invalid_stream: