summaryrefslogtreecommitdiff
path: root/src/xine-engine/vo_scale.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine/vo_scale.c')
-rw-r--r--src/xine-engine/vo_scale.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/xine-engine/vo_scale.c b/src/xine-engine/vo_scale.c
index 25ebd7265..3d11ac946 100644
--- a/src/xine-engine/vo_scale.c
+++ b/src/xine-engine/vo_scale.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: vo_scale.c,v 1.5 2002/09/04 23:31:13 guenter Exp $
+ * $Id: vo_scale.c,v 1.6 2002/09/05 05:51:15 jcdutton Exp $
*
* Contains common code to calculate video scaling parameters.
* In short, it will map frame dimensions to screen/window size.
@@ -97,7 +97,26 @@ void vo_scale_compute_ideal_size (vo_scale_t *this) {
default:
desired_ratio = 4.0 / 3.0;
}
-
+
+ corr_factor = this->display_ratio * desired_ratio / image_ratio ;
+
+ if (fabs(corr_factor - 1.0) < 0.005) {
+ this->ideal_width = this->delivered_width;
+ this->ideal_height = this->delivered_height;
+
+ } else {
+
+ if (corr_factor >= 1.0) {
+ this->ideal_width = this->delivered_width * corr_factor + 0.5;
+ this->ideal_height = this->delivered_height;
+ } else {
+ this->ideal_width = this->delivered_width;
+ this->ideal_height = this->delivered_height / corr_factor + 0.5;
+ }
+ }
+
+
+#if 0
this->video_pixel_aspect = desired_ratio / image_ratio;
assert (this->gui_pixel_aspect != 0.0);
@@ -105,6 +124,7 @@ void vo_scale_compute_ideal_size (vo_scale_t *this) {
< 0.005) {
this->video_pixel_aspect = this->gui_pixel_aspect;
}
+#endif
#if 0
@@ -343,6 +363,7 @@ void vo_scale_init(vo_scale_t *this, double display_ratio,
memset( this, 0, sizeof(vo_scale_t) );
this->display_ratio = display_ratio;
+ this->gui_pixel_aspect = display_ratio;
this->support_zoom = support_zoom;
this->scaling_disabled = scaling_disabled;
this->force_redraw = 1;