changeset 36317:56f576e4a49d

Be more consistent with movie aspect setting and check. Harmonize option "-aspect" with prescaling check and don't allow arbitrary values for command switch_ratio / variable movie_aspect.
author ib
date Wed, 07 Aug 2013 21:06:59 +0000
parents 139f2b064ef9
children df2964c3d543
files cfg-common.h command.c help/help_mp-de.h help/help_mp-en.h libmpcodecs/vd.c
diffstat 5 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-common.h	Wed Aug 07 20:41:34 2013 +0000
+++ b/cfg-common.h	Wed Aug 07 21:06:59 2013 +0000
@@ -535,7 +535,7 @@
     {"ssf", scaler_filter_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
     {"zoom", &softzoom, CONF_TYPE_FLAG, 0, 0, 1, NULL},
     {"nozoom", &softzoom, CONF_TYPE_FLAG, 0, 1, 0, NULL},
-    {"aspect", &movie_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.1, 10.0, NULL},
+    {"aspect", &movie_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.01, 10.0, NULL},
     {"noaspect", &movie_aspect, CONF_TYPE_FLAG, 0, 0, 0, NULL},
     {"xy", &screen_size_xy, CONF_TYPE_FLOAT, CONF_RANGE, 0.001, 4096, NULL},
 
--- a/command.c	Wed Aug 07 20:41:34 2013 +0000
+++ b/command.c	Wed Aug 07 21:06:59 2013 +0000
@@ -2719,8 +2719,11 @@
                 break;
             if (cmd->nargs == 0)
                 movie_aspect = -1.0;
+            else if (cmd->args[0].v.f == -1 || cmd->args[0].v.f >= 0)
+                movie_aspect = cmd->args[0].v.f;
             else
-                movie_aspect = cmd->args[0].v.f;
+                mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_InvalidSwitchRatio,
+                       cmd->args[0].v.f);
             mpcodecs_config_vo(sh_video, sh_video->disp_w, sh_video->disp_h, 0);
             break;
 
--- a/help/help_mp-de.h	Wed Aug 07 20:41:34 2013 +0000
+++ b/help/help_mp-de.h	Wed Aug 07 21:06:59 2013 +0000
@@ -200,6 +200,7 @@
 #define MSGTR_PtsAfterFiltersMissing "PTS nach Filter FEHLT\n"
 #define MSGTR_CommandLine "Kommandozeile:"
 #define MSGTR_MenuInitFailed "Initialisierung des Menüs fehlgeschlagen.\n"
+#define MSGTR_InvalidSwitchRatio "Ungültiges Seitenverhältnis '%f', es bleibt unverändert.\n"
 
 // --- edit decision lists
 #define MSGTR_EdlOutOfMem "Es kann nicht genug Speicher für EDL-Daten reserviert werden.\n"
--- a/help/help_mp-en.h	Wed Aug 07 20:41:34 2013 +0000
+++ b/help/help_mp-en.h	Wed Aug 07 21:06:59 2013 +0000
@@ -188,6 +188,7 @@
 #define MSGTR_PtsAfterFiltersMissing "pts after filters MISSING\n"
 #define MSGTR_CommandLine "CommandLine:"
 #define MSGTR_MenuInitFailed "Menu init failed.\n"
+#define MSGTR_InvalidSwitchRatio "Invalid aspect ratio '%f', it remains unchanged.\n"
 
 // --- edit decision lists
 #define MSGTR_EdlOutOfMem "Can't allocate enough memory to hold EDL data.\n"
--- a/libmpcodecs/vd.c	Wed Aug 07 20:41:34 2013 +0000
+++ b/libmpcodecs/vd.c	Wed Aug 07 21:06:59 2013 +0000
@@ -327,7 +327,7 @@
                 screen_size_y = screen_size_xy * sh->disp_h / sh->disp_w;
             }
         }
-        if (sh->aspect > 0.01) {
+        if (sh->aspect >= 0.01) {
             int w;
             mp_msg(MSGT_CPLAYER, MSGL_INFO, MSGTR_MovieAspectIsSet,
                    sh->aspect);