summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@collabora.com>2014-07-17 07:07:36 +0200
committerEdward Hervey <edward@collabora.com>2014-07-17 09:45:54 +0200
commitf1abac1109a14049fa9dab21eeaddc23dcb9fd22 (patch)
treec926b3e69e4c3ff8f08b4985cf3a26fe81842f90
parent4dca9a79a2b4fb1173ca9ee8bd2dea22ed95a951 (diff)
typefindelement: Propagate input buffer PTS and DTS
The initial buffers (that were used for timestamping) might have PTS and DTS set. In order to forward those properly, get the initial PTS/DTS from the adapter and set them on the reconstructed output buffer. https://bugzilla.gnome.org/show_bug.cgi?id=733291
-rw-r--r--plugins/elements/gsttypefindelement.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c
index 400c370fb..02ce2be66 100644
--- a/plugins/elements/gsttypefindelement.c
+++ b/plugins/elements/gsttypefindelement.c
@@ -540,6 +540,7 @@ stop_typefinding (GstTypeFindElement * typefind)
gboolean push_cached_buffers;
gsize avail;
GstBuffer *buffer;
+ GstClockTime pts, dts;
gst_element_get_state (GST_ELEMENT (typefind), &state, NULL, 0);
@@ -557,7 +558,11 @@ stop_typefinding (GstTypeFindElement * typefind)
if (avail == 0)
goto no_data;
+ pts = gst_adapter_prev_pts (typefind->adapter, NULL);
+ dts = gst_adapter_prev_dts (typefind->adapter, NULL);
buffer = gst_adapter_take_buffer (typefind->adapter, avail);
+ GST_BUFFER_PTS (buffer) = pts;
+ GST_BUFFER_DTS (buffer) = dts;
GST_OBJECT_UNLOCK (typefind);
if (!push_cached_buffers) {