[MPlayer-cvslog] r32452 - trunk/libvo/aspect.c

reimar subversion at mplayerhq.hu
Sat Oct 9 03:31:52 CEST 2010


Author: reimar
Date: Sat Oct  9 03:31:52 2010
New Revision: 32452

Log:
Add fallback values to aspect_save_screenres to avoid division by 0
if screen dimensions are not known.

Modified:
   trunk/libvo/aspect.c

Modified: trunk/libvo/aspect.c
==============================================================================
--- trunk/libvo/aspect.c	Fri Oct  8 11:00:50 2010	(r32451)
+++ trunk/libvo/aspect.c	Sat Oct  9 03:31:52 2010	(r32452)
@@ -71,6 +71,13 @@ void aspect_save_screenres(int scrw, int
 #ifdef ASPECT_DEBUG
   printf("aspect_save_screenres %dx%d \n",scrw,scrh);
 #endif
+  if (!scrw && !scrh) {
+    scrw = 1024;
+    scrh = 768;
+  } else if (scrw) {
+    scrh = (scrw * 3 + 3) / 4;
+  } else
+    scrw = (scrh * 4 + 2) / 3;
   aspdat.scrw = scrw;
   aspdat.scrh = scrh;
   if (force_monitor_aspect)


More information about the MPlayer-cvslog mailing list