diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-08-28 13:25:30 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-08-28 13:25:30 +0000 |
commit | 4ce7a487480cd5dc9effc531b9846b7bee83e766 (patch) | |
tree | 5462d16af5d7d879e8ec3efb2de8968b5af0a7cf /libvo/osx_common.c | |
parent | 0dadcc7bf0f6cd7b1b020ebcd70a87c196b769f6 (diff) | |
download | mpv-4ce7a487480cd5dc9effc531b9846b7bee83e766.tar.bz2 mpv-4ce7a487480cd5dc9effc531b9846b7bee83e766.tar.xz |
Move aspect change handling from vo_quartz to osx_common.
This could probably be even moved to video_out, though the names should
be improved.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29574 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/osx_common.c')
-rw-r--r-- | libvo/osx_common.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libvo/osx_common.c b/libvo/osx_common.c index da340438fc..aa1de118f0 100644 --- a/libvo/osx_common.c +++ b/libvo/osx_common.c @@ -43,3 +43,31 @@ int convert_key(unsigned key, unsigned charcode) return mpkey; return charcode; } + +static int our_aspect_change; +static float old_movie_aspect; + +/** + * Sends MPlayer a command to change aspect to the requested value. + * @param new_aspect desired new aspect, < 0 means restore original. + */ +void change_movie_aspect(float new_aspect) +{ + char cmd_str[64]; + if (new_aspect < 0) + new_aspect = old_movie_aspect; + our_aspect_change = 1; + snprintf(cmd_str, 64, "switch_ratio %f", old_movie_aspect); + mp_input_queue_cmd(mp_input_parse_cmd(cmd_str)); +} + +/** + * Call in config to save the original movie aspect. + * This will ignore config calls caused by change_movie_aspect. + */ +void config_movie_aspect(float config_aspect) +{ + if (!our_aspect_change) + old_movie_aspect = config_aspect; + our_aspect_change = 0; +} |