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
This commit is contained in:
Edward Hervey 2014-07-17 07:07:36 +02:00
parent 4dca9a79a2
commit f1abac1109

View file

@ -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) {