h265parse: Ensure correct timestamps

If the input has a miss-placed filler zero byte (e.g. a filler without a 4
bytes start code on the next NAL), we would endup using the same timestamp
twice. Ask the base class to read the timestamp from the buffer were the NAL
actually starts.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1251>
This commit is contained in:
Nicolas Dufresne 2020-05-07 08:29:28 -04:00
parent 80524fb3da
commit 3784bd4a73

View file

@ -1216,6 +1216,10 @@ gst_h265_parse_handle_frame (GstBaseParse * parse,
("Error parsing H.265 stream"), ("Invalid H.265 stream")); ("Error parsing H.265 stream"), ("Invalid H.265 stream"));
goto invalid_stream; goto invalid_stream;
} }
/* Ensure we use the TS of the first NAL. This avoids broken timestamp in
* the case of a miss-placed filler byte. */
gst_base_parse_set_ts_at_offset (parse, nalu.offset);
} }
while (TRUE) { while (TRUE) {