summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-10-09 01:31:52 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:18:09 +0200
commitdeba9f3d2bc171d1b987162a30a62cf06af45126 (patch)
treebe5c362e7fd5625f010a85bea4f314aba13468d9 /libvo
parent8b271d49ec6b723b026ee8c1e5156f6e0ff920ac (diff)
downloadmpv-deba9f3d2bc171d1b987162a30a62cf06af45126.tar.bz2
mpv-deba9f3d2bc171d1b987162a30a62cf06af45126.tar.xz
aspect.c: use fallback if screen dimensions are not known
Add fallback values to aspect_save_screenres to avoid division by 0 if screen dimensions are not known. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32452 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix handling of invalid values in aspect_save_screenres to not overwrite valid values. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32481 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/aspect.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libvo/aspect.c b/libvo/aspect.c
index 7b0919748e..dfe1041660 100644
--- a/libvo/aspect.c
+++ b/libvo/aspect.c
@@ -57,6 +57,12 @@ void aspect_save_screenres(struct vo *vo, int scrw, int scrh)
printf("aspect_save_screenres %dx%d \n",scrw,scrh);
#endif
struct MPOpts *opts = vo->opts;
+ if (scrw <= 0 && scrh <= 0)
+ scrw = 1024;
+ if (scrh <= 0)
+ scrh = (scrw * 3 + 3) / 4;
+ if (scrw <= 0)
+ scrw = (scrh * 4 + 2) / 3;
vo->aspdat.scrw = scrw;
vo->aspdat.scrh = scrh;
if (opts->force_monitor_aspect)