From f3b81a7de1850488fcf2af26c20cfec33a152dc8 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 19 May 2006 13:02:46 +0000 Subject: Use the gstutil scaling function to preserve 64 bits while calculating output width and height from the display-aspec... Original commit message from CVS: * gst/videoscale/gstvideoscale.c: (gst_video_scale_fixate_caps): * sys/xvimage/xvimagesink.c: (gst_xvimagesink_setcaps): Use the gstutil scaling function to preserve 64 bits while calculating output width and height from the display-aspect-ratio. (A continuation of #341542) --- sys/xvimage/xvimagesink.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sys') diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index c2f26bfc..a3315704 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -1670,15 +1670,18 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps) /* check hd / den is an integer scale factor, and scale wd with the PAR */ if (video_height % den == 0) { GST_DEBUG_OBJECT (xvimagesink, "keeping video height"); - GST_VIDEO_SINK_WIDTH (xvimagesink) = video_height * num / den; + GST_VIDEO_SINK_WIDTH (xvimagesink) = (guint) + gst_util_uint64_scale_int (video_height, num, den); GST_VIDEO_SINK_HEIGHT (xvimagesink) = video_height; } else if (video_width % num == 0) { GST_DEBUG_OBJECT (xvimagesink, "keeping video width"); GST_VIDEO_SINK_WIDTH (xvimagesink) = video_width; - GST_VIDEO_SINK_HEIGHT (xvimagesink) = video_width * den / num; + GST_VIDEO_SINK_HEIGHT (xvimagesink) = (guint) + gst_util_uint64_scale_int (video_width, den, num); } else { GST_DEBUG_OBJECT (xvimagesink, "approximating while keeping video height"); - GST_VIDEO_SINK_WIDTH (xvimagesink) = video_height * num / den; + GST_VIDEO_SINK_WIDTH (xvimagesink) = (guint) + gst_util_uint64_scale_int (video_height, num, den); GST_VIDEO_SINK_HEIGHT (xvimagesink) = video_height; } GST_DEBUG_OBJECT (xvimagesink, "scaling to %dx%d", -- cgit