diff options
author | Jordan Yelloz <jordan.yelloz@collabora.com> | 2024-07-03 07:58:58 -0600 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2024-08-02 14:54:30 +0000 |
commit | b7cfd11b72693a93cea3db66cc883253f66aa077 (patch) | |
tree | 3c2585ed85934e7f4ce322ec62be88ebe4344c0a | |
parent | 487e41b815896ae0cc352fa295b29acb6bea49f2 (diff) |
h265parse: Reject FD received before SPS
A previous fix, a275e1e029e9b5d88be26b8304c9a162e4567346, is correct but was too
permissive since it treats all un-matched NAL units the same as AU delimiters
even though some other NAL unit types can be encountered in the processing loop.
The problem this can cause is that some hardware decoders experience bad
performance when handling FD units that precede the SPS.
This change restores the original behavior for FDs so that they're ignored until
the SPS is received and it preserves the codec conformance test gains that the
fix has achieved.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7296>
-rw-r--r-- | subprojects/gst-plugins-bad/gst/videoparsers/gsth265parse.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/subprojects/gst-plugins-bad/gst/videoparsers/gsth265parse.c b/subprojects/gst-plugins-bad/gst/videoparsers/gsth265parse.c index 6b6a70effc..5994abafc5 100644 --- a/subprojects/gst-plugins-bad/gst/videoparsers/gsth265parse.c +++ b/subprojects/gst-plugins-bad/gst/videoparsers/gsth265parse.c @@ -981,6 +981,15 @@ gst_h265_parse_process_nal (GstH265Parse * h265parse, GstH265NalUnit * nalu) } break; } + case GST_H265_NAL_FD: + if (!GST_H265_PARSE_STATE_VALID (h265parse, GST_H265_PARSE_STATE_GOT_SPS)) { + GST_DEBUG_OBJECT (h265parse, "dropping FD received before SPS"); + return FALSE; + } + pres = gst_h265_parser_parse_nal (nalparser, nalu); + if (pres != GST_H265_PARSER_OK) + return FALSE; + break; case GST_H265_NAL_AUD: default: /* Just accumulate AU Delimiter, whether it's before SPS or not */ |