changeset 13339:1c787349d286

slave mode command to switch aspect ratio, patch by Aurelien Jacobs <aurel at gnuage.org>
author faust3
date Wed, 15 Sep 2004 09:45:34 +0000
parents 1820ef597cdb
children 0ed7c089f830
files input/input.c input/input.h mplayer.c
diffstat 3 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/input/input.c	Wed Sep 15 09:29:10 2004 +0000
+++ b/input/input.c	Wed Sep 15 09:45:34 2004 +0000
@@ -98,6 +98,7 @@
 #ifdef HAS_DVBIN_SUPPORT
   { MP_CMD_DVB_SET_CHANNEL, "dvb_set_channel", 2, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}}}},
 #endif
+  { MP_CMD_SWITCH_RATIO, "switch_ratio", 0, { {MP_CMD_ARG_FLOAT,{0}}, {-1,{0}} } },
   { MP_CMD_VO_FULLSCREEN, "vo_fullscreen", 0, { {-1,{0}} } },
   { MP_CMD_VO_ONTOP, "vo_ontop", 0, { {-1,{0}} } },
   { MP_CMD_VO_ROOTWIN, "vo_rootwin", 0, { {-1,{0}} } },
--- a/input/input.h	Wed Sep 15 09:29:10 2004 +0000
+++ b/input/input.h	Wed Sep 15 09:45:34 2004 +0000
@@ -56,6 +56,7 @@
 #define MP_CMD_SUB_SELECT 52
 #define MP_CMD_VO_ROOTWIN 53
 #define MP_CMD_SWITCH_VSYNC 54
+#define MP_CMD_SWITCH_RATIO 55
 
 #define MP_CMD_GUI_EVENTS       5000
 #define MP_CMD_GUI_LOADFILE     5001
--- a/mplayer.c	Wed Sep 15 09:29:10 2004 +0000
+++ b/mplayer.c	Wed Sep 15 09:45:34 2004 +0000
@@ -2530,6 +2530,13 @@
       }
       break;
 #endif
+    case MP_CMD_SWITCH_RATIO : {
+      if (cmd->nargs == 0)
+	movie_aspect = (float) sh_video->disp_w / sh_video->disp_h;
+      else
+	movie_aspect = cmd->args[0].v.f;
+      mpcodecs_config_vo (sh_video, sh_video->disp_w, sh_video->disp_h, 0);
+    } break;
     case MP_CMD_AUDIO_DELAY : {
       float v = cmd->args[0].v.f;
       audio_delay += v;