+2005-11-22 Michael Smith <msmith@fluendo.com>
+
+ * gst/videorate/gstvideorate.c: (gst_videorate_chain):
+ * gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_create):
+ Use utility method for scaling clocktime for fractional framerates.
+
2005-11-22 Jan Schmidt <thaytan@mad.scientist.com>
* ext/libvisual/visual.c: (gst_visual_src_setcaps), (get_buffer),
* gst-libs/gst/audio/audio.h:
remove some deprecated functions
+>>>>>>> 1.2127
2005-11-22 Andy Wingo <wingo@pobox.com>
* Update for gst_tag_setter API changes.
GST_BUFFER_SIZE (videorate->prevbuf));
GST_BUFFER_TIMESTAMP (outbuf) = videorate->next_ts;
videorate->out++;
- videorate->next_ts =
- videorate->first_ts +
- (videorate->out * GST_SECOND *
- videorate->to_rate_denominator / videorate->to_rate_numerator);
- GST_BUFFER_DURATION (outbuf) =
- videorate->next_ts - GST_BUFFER_TIMESTAMP (outbuf);
+ if (videorate->to_rate_numerator) {
+ videorate->next_ts =
+ videorate->first_ts +
+ gst_util_clocktime_scale (videorate->out * GST_SECOND,
+ videorate->to_rate_denominator, videorate->to_rate_numerator);
+ GST_BUFFER_DURATION (outbuf) =
+ videorate->next_ts - GST_BUFFER_TIMESTAMP (outbuf);
+ }
/* adapt for looping */
GST_BUFFER_TIMESTAMP (outbuf) -= videorate->segment_accum;
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (videorate->srcpad));
GST_BUFFER_TIMESTAMP (outbuf) = src->timestamp_offset + src->running_time;
if (src->rate_numerator != 0) {
- GST_BUFFER_DURATION (outbuf) = GST_SECOND * src->rate_denominator /
- src->rate_numerator;
+ GST_BUFFER_DURATION (outbuf) = gst_utils_clocktime_scale (GST_SECOND,
+ src->rate_denominator, src->rate_numerator);
}
src->n_frames++;
if (src->rate_numerator != 0) {
- src->running_time = src->n_frames * GST_SECOND * src->rate_denominator /
- src->rate_numerator;
+ src->running_time = gst_utils_clocktime_scale (src->n_frames * GST_SECOND,
+ src->rate_denominator, src->rate_numerator);
}
*buffer = outbuf;