summaryrefslogtreecommitdiffstats
path: root/libvo/vo_corevideo.m
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-07-25 11:38:45 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:14:45 +0200
commitf4f8c1f7e93703e545d73f6b0b763750e64f18b8 (patch)
tree90265f9a0e9fa10240aa68d079dfcb0406d2cbdd /libvo/vo_corevideo.m
parent0a5ff5eef340cc4b132b036690ee168cd4bd8f4a (diff)
downloadmpv-f4f8c1f7e93703e545d73f6b0b763750e64f18b8.tar.bz2
mpv-f4f8c1f7e93703e545d73f6b0b763750e64f18b8.tar.xz
vo_corevideo: Simplify update_screen_info
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31806 b3059339-0415-0410-9bf9-f77b7e298cf2 Avoid some code duplication in update_screen_info. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31807 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_corevideo.m')
-rw-r--r--libvo/vo_corevideo.m13
1 files changed, 6 insertions, 7 deletions
diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m
index aa7bffe310..fe6314ce5d 100644
--- a/libvo/vo_corevideo.m
+++ b/libvo/vo_corevideo.m
@@ -122,18 +122,17 @@ static void update_screen_info(void)
screen_id = xinerama_screen;
screen_array = [NSScreen screens];
- if(screen_id < (int)[screen_array count])
- {
- screen_handle = [screen_array objectAtIndex:(screen_id < 0 ? 0 : screen_id)];
- }
- else
+ if(screen_id >= (int)[screen_array count])
{
mp_msg(MSGT_VO, MSGL_INFO, "[vo_corevideo] Device ID %d does not exist, falling back to main device\n", screen_id);
- screen_handle = [screen_array objectAtIndex:0];
screen_id = -1;
}
+ if (screen_id < 0 && [mpGLView window])
+ screen_handle = [[mpGLView window] screen];
+ else
+ screen_handle = [screen_array objectAtIndex:(screen_id < 0 ? 0 : screen_id)];
- screen_frame = ![mpGLView window] || screen_id >= 0 ? [screen_handle frame] : [[[mpGLView window] screen] frame];
+ screen_frame = [screen_handle frame];
vo_screenwidth = screen_frame.size.width;
vo_screenheight = screen_frame.size.height;
xinerama_x = xinerama_y = 0;