Add vertical clipping for subtitles that were moved because of a collision.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19670 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
eugeni 2006-09-04 17:55:57 +00:00
parent 06ffbd9d7d
commit d764df09de
1 changed files with 15 additions and 0 deletions

View File

@ -1943,6 +1943,21 @@ static void shift_event(event_images_t* ei, int shift)
ass_image_t* cur = ei->imgs;
while (cur) {
cur->dst_y += shift;
// clip top and bottom
if (cur->dst_y < 0) {
int clip = - cur->dst_y;
cur->h -= clip;
cur->bitmap += clip * cur->stride;
cur->dst_y = 0;
}
if (cur->dst_y + cur->h >= frame_context.height) {
int clip = cur->dst_y + cur->h - frame_context.height;
cur->h -= clip;
}
if (cur->h <= 0) {
cur->h = 0;
cur->dst_y = 0;
}
cur = cur->next;
}
ei->top += shift;