diff options
Diffstat (limited to 'libhb/rendersub.c')
-rw-r--r-- | libhb/rendersub.c | 12 |
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; } |