summaryrefslogtreecommitdiffstats
path: root/spudec.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-07-11 12:46:12 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:14:43 +0200
commit16a14da73038d5bbe0e2bf068491817ac017fead (patch)
treef24946de41f5b0d6d2dc3be1e9ea7cc2b5111dca /spudec.c
parentf8509c52c02a59e604f0424f545c29fa9d8adb9e (diff)
downloadmpv-16a14da73038d5bbe0e2bf068491817ac017fead.tar.bz2
mpv-16a14da73038d5bbe0e2bf068491817ac017fead.tar.xz
spudec: Fix calc_bbox to always return sensible values
When the scaled width is equal to the current width we could reuse the previous bbox value, however we havent saved them anywhere... git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31701 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'spudec.c')
-rw-r--r--spudec.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/spudec.c b/spudec.c
index 15cc1c6420..88daf45875 100644
--- a/spudec.c
+++ b/spudec.c
@@ -691,12 +691,14 @@ void spudec_calc_bbox(void *me, unsigned int dxs, unsigned int dys, unsigned int
spu = (spudec_handle_t *)me;
if (spu->orig_frame_width == 0 || spu->orig_frame_height == 0
|| (spu->orig_frame_width == dxs && spu->orig_frame_height == dys)) {
+ // unscaled
bbox[0] = spu->start_col;
bbox[1] = spu->start_col + spu->width;
bbox[2] = spu->start_row;
bbox[3] = spu->start_row + spu->height;
}
- else if (spu->scaled_frame_width != dxs || spu->scaled_frame_height != dys) {
+ else {
+ // scaled
unsigned int scalex = 0x100 * dxs / spu->orig_frame_width;
unsigned int scaley = 0x100 * dys / spu->orig_frame_height;
bbox[0] = spu->start_col * scalex / 0x100;
@@ -726,9 +728,6 @@ void spudec_calc_bbox(void *me, unsigned int dxs, unsigned int dys, unsigned int
bbox[3] = spu->start_row * scaley / 0x100 + spu->height * scaley / 0x100;
break;
}
- } else {
- mp_msg(MSGT_SPUDEC, MSGL_ERR, "Bad values in spudec_calc_bbox\n");
- bbox[0] = bbox[1] = bbox[2] = bbox[3] = 0;
}
}
/* transform mplayer's alpha value into an opacity value that is linear */