diff options
author | Jan Schmidt <thaytan@mad.scientist.com> | 2006-05-19 13:02:46 +0000 |
---|---|---|
committer | Jan Schmidt <thaytan@mad.scientist.com> | 2006-05-19 13:02:46 +0000 |
commit | f3b81a7de1850488fcf2af26c20cfec33a152dc8 (patch) | |
tree | b5347fb288c1da3443d6190d523c25280e29c31f /sys | |
parent | 47e7f3f367d3a6d1a120abd81915b98a7ed694c9 (diff) |
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)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/xvimage/xvimagesink.c | 9 |
1 files changed, 6 insertions, 3 deletions
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", |