From 5f76d2416b181f2b423f9d02c8029edd45545b3e Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 4 Sep 2009 18:21:28 +0000 Subject: Subopt parser subopts should now be const. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29645 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_corevideo.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libvo/vo_corevideo.m') diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m index 099963c167..3adfa5d856 100644 --- a/libvo/vo_corevideo.m +++ b/libvo/vo_corevideo.m @@ -337,7 +337,7 @@ static void uninit(void) buffer_name = NULL; } -static opt_t subopts[] = { +static const opt_t subopts[] = { {"device_id", OPT_ARG_INT, &screen_id, NULL}, {"shared_buffer", OPT_ARG_BOOL, &shared_buffer, NULL}, {"buffer_name", OPT_ARG_MSTRZ,&buffer_name, NULL}, -- cgit v1.2.3 From 76d4cd713f35c199ad9685c799ed604aa1237d8f Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 4 Sep 2009 18:43:28 +0000 Subject: Factor out duplicated code to set play video scaled by a certain factor. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29646 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_corevideo.m | 60 ++++++++++++++++++---------------------------------- 1 file changed, 21 insertions(+), 39 deletions(-) (limited to 'libvo/vo_corevideo.m') diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m index 3adfa5d856..18a2820360 100644 --- a/libvo/vo_corevideo.m +++ b/libvo/vo_corevideo.m @@ -594,58 +594,40 @@ static int control(uint32_t request, void *data, ...) [menuItem release]; } +- (void)set_winSizeMult:(float)mult +{ + NSRect frame; + int d_width, d_height; + aspect(&d_width, &d_height, A_NOZOOM); + + if (isFullscreen) { + vo_fs = !vo_fs; + [self fullscreen:NO]; + } + + winSizeMult = mult; + frame.size.width = d_width * mult; + frame.size.height = d_height * mult; + [window setContentSize: frame.size]; + [self reshape]; +} + /* Menu Action */ - (void)menuAction:(id)sender { - uint32_t d_width; - uint32_t d_height; - NSRect frame; - - aspect((int *)&d_width, (int *)&d_height,A_NOZOOM); - if(sender == kQuitCmd) { mplayer_put_key(KEY_ESC); } if(sender == kHalfScreenCmd) - { - if(isFullscreen) { - vo_fs = (!(vo_fs)); [self fullscreen:NO]; - } - - winSizeMult = 0.5; - frame.size.width = d_width*winSizeMult; - frame.size.height = d_height*winSizeMult; - [window setContentSize: frame.size]; - [self reshape]; - } + [self set_winSizeMult: 0.5]; if(sender == kNormalScreenCmd) - { - if(isFullscreen) { - vo_fs = (!(vo_fs)); [self fullscreen:NO]; - } - - winSizeMult = 1; - frame.size.width = d_width; - frame.size.height = d_height; - [window setContentSize: frame.size]; - [self reshape]; - } + [self set_winSizeMult: 1]; if(sender == kDoubleScreenCmd) - { - if(isFullscreen) { - vo_fs = (!(vo_fs)); [self fullscreen:NO]; - } - - winSizeMult = 2; - frame.size.width = d_width*winSizeMult; - frame.size.height = d_height*winSizeMult; - [window setContentSize: frame.size]; - [self reshape]; - } + [self set_winSizeMult: 2]; if(sender == kFullScreenCmd) { vo_fs = (!(vo_fs)); -- cgit v1.2.3