Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/hotfix/add-parent-meta-to-compen…
Browse files Browse the repository at this point in the history
…sated-buffers' into develop
  • Loading branch information
migueltaylor committed Jan 31, 2023
2 parents d61a7cd + 5034a92 commit b407bee
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gst/interpipe/gstinterpipesrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ gst_inter_pipe_src_push_buffer (GstInterPipeIListener * iface,
GstAppSrc *appsrc;
GstFlowReturn ret;
guint64 srcbasetime;
GstBuffer *parentbuffer;

src = GST_INTER_PIPE_SRC (iface);
appsrc = GST_APP_SRC (src);
Expand All @@ -644,7 +645,10 @@ gst_inter_pipe_src_push_buffer (GstInterPipeIListener * iface,
if (GST_INTER_PIPE_SRC_COMPENSATE_TIMESTAMP == src->stream_sync) {
guint64 difftime;

parentbuffer = gst_buffer_ref (buffer);
buffer = gst_buffer_make_writable (buffer);
gst_buffer_add_parent_buffer_meta (buffer, parentbuffer);
gst_buffer_unref (parentbuffer);

srcbasetime = gst_element_get_base_time (GST_ELEMENT (appsrc));

Expand Down Expand Up @@ -681,6 +685,11 @@ gst_inter_pipe_src_push_buffer (GstInterPipeIListener * iface,
"Calculated Buffer Timestamp (PTS): %" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_PTS (buffer)));
} else if (GST_INTER_PIPE_SRC_RESTART_TIMESTAMP == src->stream_sync) {
parentbuffer = gst_buffer_ref (buffer);
buffer = gst_buffer_make_writable (buffer);
gst_buffer_add_parent_buffer_meta (buffer, parentbuffer);
gst_buffer_unref (parentbuffer);

/* Remove the incoming timestamp to be generated according this basetime */
buffer = gst_buffer_make_writable (buffer);
GST_BUFFER_PTS (buffer) = GST_CLOCK_TIME_NONE;
Expand Down

0 comments on commit b407bee

Please sign in to comment.