From 6d7c707f86bdb658bc8124dc174804ce94f88e37 Mon Sep 17 00:00:00 2001 From: "Joshua M. Doe" Date: Mon, 16 Jul 2012 03:14:36 -0400 Subject: [PATCH] niimaqsrc: subtract element base time Pipeline can now properly go back and forth between PLAYING and NULL. --- sys/niimaq/gstniimaq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/niimaq/gstniimaq.c b/sys/niimaq/gstniimaq.c index bd9a7c9..c398aef 100644 --- a/sys/niimaq/gstniimaq.c +++ b/sys/niimaq/gstniimaq.c @@ -647,6 +647,8 @@ gst_niimaqsrc_set_caps (GstBaseSrc * bsrc, GstCaps * caps) static void gst_niimaqsrc_reset (GstNiImaqSrc * niimaqsrc) { + GST_LOG_OBJECT (niimaqsrc, "Resetting instance"); + /* initialize member variables */ niimaqsrc->n_frames = 0; niimaqsrc->cumbufnum = 0; @@ -824,7 +826,8 @@ gst_niimaqsrc_create (GstPushSrc * psrc, GstBuffer ** buffer) GST_BUFFER_OFFSET (*buffer) = copied_number; GST_BUFFER_OFFSET_END (*buffer) = copied_number + 1; - GST_BUFFER_TIMESTAMP (*buffer) = timestamp; + GST_BUFFER_TIMESTAMP (*buffer) = + timestamp - gst_element_get_base_time (GST_ELEMENT (niimaqsrc)); GST_BUFFER_DURATION (*buffer) = duration; /* the negotiate() method already set caps on the source pad */