summaryrefslogtreecommitdiffstats
path: root/libvo/video_out.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-02-17 11:59:49 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-02-17 11:59:49 +0000
commit01ef7e45790e1f0dd2277f73c583c9a503b2b6bd (patch)
treee513cf8669a9f80b1a9e77fe4e41b449d6f5a1ac /libvo/video_out.c
parenta845504a5ee6fd7e545f028cf84e1e503da574c1 (diff)
downloadmpv-01ef7e45790e1f0dd2277f73c583c9a503b2b6bd.tar.bz2
mpv-01ef7e45790e1f0dd2277f73c583c9a503b2b6bd.tar.xz
Extend calc_src_dst_rects to also calculate the border values needed for
correctly placed dvdnav highlights, and fix direct3d and vdpau accordingly. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28633 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/video_out.c')
-rw-r--r--libvo/video_out.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c
index a444e680e4..945759f0a8 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -387,8 +387,11 @@ static void src_dst_split_scaling(int src_size, int dst_size, int scaled_src_siz
* Can be extended to take future cropping support into account.
*
* \param crop specifies the cropping border size in the left, right, top and bottom members, may be NULL
+ * \param borders the border values as e.g. EOSD (ASS) and properly placed DVD highlight support requires,
+ * may be NULL and only left and top are currently valid.
*/
-void calc_src_dst_rects(int src_width, int src_height, struct vo_rect *src, struct vo_rect *dst, const struct vo_rect *crop) {
+void calc_src_dst_rects(int src_width, int src_height, struct vo_rect *src, struct vo_rect *dst,
+ struct vo_rect *borders, const struct vo_rect *crop) {
static const struct vo_rect no_crop = {0, 0, 0, 0, 0, 0};
int scaled_width = 0;
int scaled_height = 0;
@@ -401,11 +404,18 @@ void calc_src_dst_rects(int src_width, int src_height, struct vo_rect *src, stru
dst->top = 0; dst->bottom = vo_dheight;
src->left = 0; src->right = src_width;
src->top = 0; src->bottom = src_height;
+ if (borders) {
+ borders->left = 0; borders->top = 0;
+ }
if (vo_fs) {
aspect(&scaled_width, &scaled_height, A_ZOOM);
panscan_calc();
scaled_width += vo_panscan_x;
scaled_height += vo_panscan_y;
+ if (borders) {
+ borders->left = (vo_dwidth - scaled_width ) / 2;
+ borders->top = (vo_dheight - scaled_height) / 2;
+ }
src_dst_split_scaling(src_width, vo_dwidth, scaled_width,
&src->left, &src->right, &dst->left, &dst->right);
src_dst_split_scaling(src_height, vo_dheight, scaled_height,