2005-12-15 Michael Smith <msmith@fluendo.com>
+ * gst/videorate/gstvideorate.c: (gst_video_rate_blank_data),
+ (gst_video_rate_chain):
+ Fix timestamping for videorate when the first buffer it sees has a
+ non-zero timestamp. Fix some misleading debug output.
+
+2005-12-15 Michael Smith <msmith@fluendo.com>
+
* gst/audioresample/gstaudioresample.c:
Don't leak all input buffers to audioresample.
gint from_rate_numerator, from_rate_denominator;
gint to_rate_numerator, to_rate_denominator;
guint64 next_ts; /* Timestamp of next buffer to output */
- guint64 first_ts; /* Timestamp of first buffer */
GstBuffer *prevbuf;
guint64 prev_ts; /* Previous buffer timestamp */
guint64 in, out, dup, drop;
videorate->drop = 0;
videorate->dup = 0;
videorate->next_ts = 0LL;
- videorate->first_ts = 0LL;
videorate->prev_ts = 0LL;
videorate->segment_start = 0;
if (videorate->prevbuf == NULL) {
/* We're sure it's a GstBuffer here */
videorate->prevbuf = buffer;
- videorate->next_ts = videorate->first_ts = videorate->prev_ts =
+ videorate->prev_ts =
GST_BUFFER_TIMESTAMP (buffer) - videorate->segment_start +
videorate->segment_accum;
+ videorate->next_ts = 0;
} else {
GstClockTime prevtime, intime;
gint count = 0;
/* output first one when its the best */
if (diff1 < diff2) {
GstBuffer *outbuf;
+ GstClockTime push_ts;
count++;
outbuf =
gst_buffer_create_sub (videorate->prevbuf, 0,
GST_BUFFER_SIZE (videorate->prevbuf));
GST_BUFFER_TIMESTAMP (outbuf) = videorate->next_ts;
+ push_ts = GST_BUFFER_TIMESTAMP (outbuf);
videorate->out++;
if (videorate->to_rate_numerator) {
videorate->next_ts =
- videorate->first_ts +
gst_util_uint64_scale_int (videorate->out * GST_SECOND,
videorate->to_rate_denominator, videorate->to_rate_numerator);
GST_BUFFER_DURATION (outbuf) =
GST_LOG_OBJECT (videorate,
"old is best, dup, pushing buffer outgoing ts %" GST_TIME_FORMAT,
- GST_TIME_ARGS (videorate->next_ts));
+ GST_TIME_ARGS (push_ts));
if ((res = gst_pad_push (videorate->srcpad, outbuf)) != GST_FLOW_OK) {
GST_WARNING_OBJECT (videorate, "couldn't push buffer on srcpad:%d",
GST_LOG_OBJECT (videorate,
"old is best, dup, pushed buffer outgoing ts %" GST_TIME_FORMAT,
- GST_TIME_ARGS (videorate->next_ts));
+ GST_TIME_ARGS (push_ts));
}
/* continue while the first one was the best */
}