summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@intel.com>2022-11-22 15:50:44 +0800
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-02-21 16:03:58 +0000
commitf4bb5123e4118610b7ef05e87f12c70d74f55943 (patch)
treed701490f8f3d2cf448928f5f0aff93f38fb6b188
parentf12769b86000b5596d9c31eb8c33457e62cc507e (diff)
downloadgstreamer-f4bb5123e4118610b7ef05e87f12c70d74f55943.tar.gz
h264parse: Add the missing timestamp when splitting a frame.
When splitting a frame, the gst_buffer_copy_region() does not copy the timestamp correctly for sub frames when the offset is not 0. We still need those timestamps for each output sub frame. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4025>
-rw-r--r--subprojects/gst-plugins-bad/gst/videoparsers/gsth264parse.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/subprojects/gst-plugins-bad/gst/videoparsers/gsth264parse.c b/subprojects/gst-plugins-bad/gst/videoparsers/gsth264parse.c
index 387cde20fb..11581b09e5 100644
--- a/subprojects/gst-plugins-bad/gst/videoparsers/gsth264parse.c
+++ b/subprojects/gst-plugins-bad/gst/videoparsers/gsth264parse.c
@@ -1254,6 +1254,10 @@ gst_h264_parse_handle_frame_packetized (GstBaseParse * parse,
tmp_frame.overhead = frame->overhead;
tmp_frame.buffer = gst_buffer_copy_region (buffer, GST_BUFFER_COPY_ALL,
nalu.offset, nalu.size);
+ /* Don't lose timestamp when offset is not 0. */
+ GST_BUFFER_PTS (tmp_frame.buffer) = GST_BUFFER_PTS (buffer);
+ GST_BUFFER_DTS (tmp_frame.buffer) = GST_BUFFER_DTS (buffer);
+ GST_BUFFER_DURATION (tmp_frame.buffer) = GST_BUFFER_DURATION (buffer);
/* Set marker on last packet */
if (nl + nalu.size == left) {