Commit 66901ce1 authored by Oneric's avatar Oneric Committed by James Almer

avfilter/vf_subtitles: pass storage size to libass

Due to a quirk of the ASS format some tags depend on the exact storage
resolution of the video, so tell libass via ass_set_storage_size.
Reviewed-by: 's avatarSoft Works <softworkz@hotmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 1728ad82
......@@ -147,9 +147,13 @@ static int config_input(AVFilterLink *inlink)
ff_draw_init(&ass->draw, inlink->format, ass->alpha ? FF_DRAW_PROCESS_ALPHA : 0);
ass_set_frame_size (ass->renderer, inlink->w, inlink->h);
if (ass->original_w && ass->original_h)
if (ass->original_w && ass->original_h) {
ass_set_pixel_aspect(ass->renderer, (double)inlink->w / inlink->h /
((double)ass->original_w / ass->original_h));
ass_set_storage_size(ass->renderer, ass->original_w, ass->original_h);
} else
ass_set_storage_size(ass->renderer, inlink->w, inlink->h);
if (ass->shaping != -1)
ass_set_shaper(ass->renderer, ass->shaping);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment