summaryrefslogtreecommitdiffstats
path: root/libhb/rendersub.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2012-05-05 19:29:01 +0000
committerjstebbins <[email protected]>2012-05-05 19:29:01 +0000
commit30d9ab93d655465ddc78cfc7ca45355281a2f411 (patch)
tree69756cc7b14d3260a785efee83b7a275563202f4 /libhb/rendersub.c
parent06254850dc2c1ec43d57f4d8e2026fa67967d5b9 (diff)
libhb: yet another fix for ssa burn-in positioning problem
We must offset the position that libass gives us by the top and left cropping since the frame size we are telling libass to render into has the cropping removed. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4643 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/rendersub.c')
-rw-r--r--libhb/rendersub.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libhb/rendersub.c b/libhb/rendersub.c
index 4032a48df..5d428e4d3 100644
--- a/libhb/rendersub.c
+++ b/libhb/rendersub.c
@@ -329,7 +329,7 @@ static uint8_t ssaAlpha( ASS_Image *frame, int x, int y )
return (uint8_t)alpha;
}
-static hb_buffer_t * RenderSSAFrame( ASS_Image * frame )
+static hb_buffer_t * RenderSSAFrame( hb_filter_private_t * pv, ASS_Image * frame )
{
hb_buffer_t *sub;
int xx, yy;
@@ -376,8 +376,8 @@ static hb_buffer_t * RenderSSAFrame( ASS_Image * frame )
}
sub->f.width = frame->w;
sub->f.height = frame->h;
- sub->f.x = frame->dst_x;
- sub->f.y = frame->dst_y;
+ sub->f.x = frame->dst_x + pv->crop[2];
+ sub->f.y = frame->dst_y + pv->crop[0];
return sub;
}
@@ -393,7 +393,7 @@ static void ApplySSASubs( hb_filter_private_t * pv, hb_buffer_t * buf )
ASS_Image *frame;
for (frame = frameList; frame; frame = frame->next) {
- sub = RenderSSAFrame( frame );
+ sub = RenderSSAFrame( pv, frame );
if( sub )
{
ApplySub( pv, buf, sub );
@@ -482,10 +482,6 @@ static int ssa_init( hb_filter_object_t * filter,
double par = (double)init->par_width / init->par_height;
ass_set_aspect_ratio( pv->renderer, 1, par );
- // libass will take care of positioning for us, so we don't need to
- // compensate for crop.
- pv->crop[0] = pv->crop[1] = pv->crop[2] = pv->crop[3] = 0;
-
return 0;
}