From 43b6b750c654a748063b599a6908621079ab9acd Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Thu, 5 Aug 2004 17:41:33 +0000 Subject: [PATCH] move common code out of if Original commit message from CVS: move common code out of if --- gst/videotestsrc/gstvideotestsrc.c | 11 +++-------- gst/videotestsrc/gstvideotestsrc.h | 5 +++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index 760722a..76def35 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -575,19 +575,14 @@ gst_videotestsrc_get (GstPad * pad) videotestsrc->make_image (videotestsrc, (void *) GST_BUFFER_DATA (buf), videotestsrc->width, videotestsrc->height); + GST_BUFFER_TIMESTAMP (buf) = videotestsrc->timestamp_offset + + (videotestsrc->n_frames * GST_SECOND) / (double) videotestsrc->rate; + videotestsrc->n_frames++; if (videotestsrc->sync) { - GST_BUFFER_TIMESTAMP (buf) = videotestsrc->timestamp_offset + - (videotestsrc->n_frames * GST_SECOND) / (double) videotestsrc->rate; - videotestsrc->n_frames++; - /* FIXME this is not correct if we do QoS */ if (videotestsrc->clock) { gst_element_wait (GST_ELEMENT (videotestsrc), GST_BUFFER_TIMESTAMP (buf)); } - } else { - GST_BUFFER_TIMESTAMP (buf) = videotestsrc->timestamp_offset + - (videotestsrc->n_frames * GST_SECOND) / (double) videotestsrc->rate; - videotestsrc->n_frames++; } GST_BUFFER_DURATION (buf) = GST_SECOND / (double) videotestsrc->rate; diff --git a/gst/videotestsrc/gstvideotestsrc.h b/gst/videotestsrc/gstvideotestsrc.h index 68d2eb0..f18dca2 100644 --- a/gst/videotestsrc/gstvideotestsrc.h +++ b/gst/videotestsrc/gstvideotestsrc.h @@ -60,8 +60,9 @@ struct _GstVideotestsrc { struct fourcc_list_struct *fourcc; /* private */ - gint64 timestamp_offset; - gint64 n_frames; + gint64 timestamp_offset; /* base offset */ + GstClockTime running_time; /* total running time */ + gint64 n_frames; /* total frames sent */ gint bpp; gdouble rate; int type; -- 2.7.4