comparison 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
comparison
equal deleted inserted replaced
14677:eb884d12bad5 14678:58f061d12c83
29 if(sscanf(vo_geometry, "%ix%i", &width, &height) != 2) 29 if(sscanf(vo_geometry, "%ix%i", &width, &height) != 2)
30 { 30 {
31 RESET_GEOMETRY 31 RESET_GEOMETRY
32 if(sscanf(vo_geometry, "+%i+%i", &xoff, &yoff) != 2) 32 if(sscanf(vo_geometry, "+%i+%i", &xoff, &yoff) != 2)
33 { 33 {
34 char percent[2];
34 RESET_GEOMETRY 35 RESET_GEOMETRY
35 if(sscanf(vo_geometry, "%i:%i", &xoff, &yoff) != 2) 36 if(sscanf(vo_geometry, "%i%%:%i%1[%]", &xper, &yper, &percent) != 3)
36 { 37 {
37 RESET_GEOMETRY 38 RESET_GEOMETRY
38 if(sscanf(vo_geometry, "%i:%i%%", &xper, &yper) != 2) 39 if(sscanf(vo_geometry, "%i:%i%1[%]", &xoff, &yper, &percent) != 3)
39 { 40 {
40 RESET_GEOMETRY 41 RESET_GEOMETRY
41 if(sscanf(vo_geometry, "%i%%:%i", &xper, &yper) != 2) 42 if(sscanf(vo_geometry, "%i%%:%i", &xper, &yoff) != 2)
42 { 43 {
43 RESET_GEOMETRY 44 RESET_GEOMETRY
44 if(sscanf(vo_geometry, "%i%%:%i%%", &xper, &yper) != 2) 45 if(sscanf(vo_geometry, "%i:%i", &xoff, &yoff) != 2)
45 { 46 {
46 RESET_GEOMETRY 47 RESET_GEOMETRY
47 if(sscanf(vo_geometry, "%i%%", &xper) != 1) 48 if(sscanf(vo_geometry, "%i%1[%]", &xper, &percent) != 2)
48 { 49 {
49 mp_msg(MSGT_VO, MSGL_ERR, 50 mp_msg(MSGT_VO, MSGL_ERR,
50 "-geometry must be in [WxH][+X+Y] | [X[%%]:[Y[%%]]] format, incorrect (%s)\n", vo_geometry); 51 "-geometry must be in [WxH][+X+Y] | [X[%%]:[Y[%%]]] format, incorrect (%s)\n", vo_geometry);
51 return 0; 52 return 0;
52 } 53 }