inter: Use 64-bit safe scaling functions

This commit is contained in:
Sebastian Dröge 2014-10-27 15:34:58 +01:00
parent 6505e84f7c
commit 56e49ce3b6
2 changed files with 6 additions and 6 deletions

View file

@ -303,7 +303,7 @@ gst_inter_audio_src_create (GstBaseSrc * src, guint64 offset, guint size,
&interaudiosrc->info)) {
caps = gst_audio_info_to_caps (&interaudiosrc->surface->audio_info);
interaudiosrc->timestamp_offset +=
gst_util_uint64_scale_int (interaudiosrc->n_samples, GST_SECOND,
gst_util_uint64_scale (interaudiosrc->n_samples, GST_SECOND,
interaudiosrc->info.rate);
interaudiosrc->n_samples = 0;
}
@ -364,12 +364,12 @@ gst_inter_audio_src_create (GstBaseSrc * src, guint64 offset, guint size,
GST_BUFFER_OFFSET (buffer) = interaudiosrc->n_samples;
GST_BUFFER_OFFSET_END (buffer) = interaudiosrc->n_samples + n;
GST_BUFFER_TIMESTAMP (buffer) = interaudiosrc->timestamp_offset +
gst_util_uint64_scale_int (interaudiosrc->n_samples, GST_SECOND,
gst_util_uint64_scale (interaudiosrc->n_samples, GST_SECOND,
interaudiosrc->info.rate);
GST_DEBUG_OBJECT (interaudiosrc, "create ts %" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)));
GST_BUFFER_DURATION (buffer) = interaudiosrc->timestamp_offset +
gst_util_uint64_scale_int (interaudiosrc->n_samples + n, GST_SECOND,
gst_util_uint64_scale (interaudiosrc->n_samples + n, GST_SECOND,
interaudiosrc->info.rate) - GST_BUFFER_TIMESTAMP (buffer);
GST_BUFFER_FLAG_UNSET (buffer, GST_BUFFER_FLAG_DISCONT);
if (interaudiosrc->n_samples == 0) {

View file

@ -317,7 +317,7 @@ gst_inter_video_src_create (GstBaseSrc * src, guint64 offset, guint size,
&intervideosrc->info)) {
caps = gst_video_info_to_caps (&intervideosrc->surface->video_info);
intervideosrc->timestamp_offset +=
gst_util_uint64_scale_int (GST_SECOND * intervideosrc->n_frames,
gst_util_uint64_scale (GST_SECOND * intervideosrc->n_frames,
GST_VIDEO_INFO_FPS_D (&intervideosrc->info),
GST_VIDEO_INFO_FPS_N (&intervideosrc->info));
intervideosrc->n_frames = 0;
@ -351,14 +351,14 @@ gst_inter_video_src_create (GstBaseSrc * src, guint64 offset, guint size,
buffer = gst_buffer_make_writable (buffer);
GST_BUFFER_PTS (buffer) = intervideosrc->timestamp_offset +
gst_util_uint64_scale_int (GST_SECOND * intervideosrc->n_frames,
gst_util_uint64_scale (GST_SECOND * intervideosrc->n_frames,
GST_VIDEO_INFO_FPS_D (&intervideosrc->info),
GST_VIDEO_INFO_FPS_N (&intervideosrc->info));
GST_BUFFER_DTS (buffer) = GST_CLOCK_TIME_NONE;
GST_DEBUG_OBJECT (intervideosrc, "create ts %" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_PTS (buffer)));
GST_BUFFER_DURATION (buffer) = intervideosrc->timestamp_offset +
gst_util_uint64_scale_int (GST_SECOND * (intervideosrc->n_frames + 1),
gst_util_uint64_scale (GST_SECOND * (intervideosrc->n_frames + 1),
GST_VIDEO_INFO_FPS_D (&intervideosrc->info),
GST_VIDEO_INFO_FPS_N (&intervideosrc->info)) - GST_BUFFER_PTS (buffer);
GST_BUFFER_OFFSET (buffer) = intervideosrc->n_frames;