diff libvo/geometry.c @ 14678:58f061d12c83

Fix the behaviour of -geometry according to the documentation. Patch by Bjorn Danielsson <mplayer-mail ta dax tod nu>
author al
date Wed, 09 Feb 2005 17:58:41 +0000
parents e047e70a9767
children f48dc20c9185
line wrap: on
line diff
--- a/libvo/geometry.c	Wed Feb 09 16:49:39 2005 +0000
+++ b/libvo/geometry.c	Wed Feb 09 17:58:41 2005 +0000
@@ -31,20 +31,21 @@
 		  RESET_GEOMETRY
 		  if(sscanf(vo_geometry, "+%i+%i", &xoff, &yoff) != 2)
 		  {
+		   char percent[2];
 		   RESET_GEOMETRY
-		   if(sscanf(vo_geometry, "%i:%i", &xoff, &yoff) != 2)
+		   if(sscanf(vo_geometry, "%i%%:%i%1[%]", &xper, &yper, &percent) != 3)
 		   {
 		    RESET_GEOMETRY
-		    if(sscanf(vo_geometry, "%i:%i%%", &xper, &yper) != 2)
+		    if(sscanf(vo_geometry, "%i:%i%1[%]", &xoff, &yper, &percent) != 3)
 		    {
 		     RESET_GEOMETRY
-		     if(sscanf(vo_geometry, "%i%%:%i", &xper, &yper) != 2)
+		     if(sscanf(vo_geometry, "%i%%:%i", &xper, &yoff) != 2)
 		     {
 		     RESET_GEOMETRY
-		     if(sscanf(vo_geometry, "%i%%:%i%%", &xper, &yper) != 2)
+		     if(sscanf(vo_geometry, "%i:%i", &xoff, &yoff) != 2)
 		     {
 		      RESET_GEOMETRY
-		      if(sscanf(vo_geometry, "%i%%", &xper) != 1)
+		      if(sscanf(vo_geometry, "%i%1[%]", &xper, &percent) != 2)
 		      {
 			mp_msg(MSGT_VO, MSGL_ERR,
 			    "-geometry must be in [WxH][+X+Y] | [X[%%]:[Y[%%]]] format, incorrect (%s)\n", vo_geometry);