summaryrefslogtreecommitdiffstats
path: root/libhb/decpgssub.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2015-09-04 08:40:43 -0700
committerJohn Stebbins <[email protected]>2015-09-24 09:28:28 -0700
commit78182d366b6f1981bd4300192dc174dd2123f4f5 (patch)
treea64e241a2a597635ca8a6c1a4344e0c6f447fd98 /libhb/decpgssub.c
parent8e38bee64ad60e7e5e53b0b1a4af1b4b4beeb05a (diff)
rendersub: handle mismatched video and subtitle dimensions
The video frame subtitles are meant to be rendered to may not match the actual video we are encoding. So scale to match as needed.
Diffstat (limited to 'libhb/decpgssub.c')
-rw-r--r--libhb/decpgssub.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libhb/decpgssub.c b/libhb/decpgssub.c
index 4f60f5722..9b0bd4212 100644
--- a/libhb/decpgssub.c
+++ b/libhb/decpgssub.c
@@ -411,14 +411,16 @@ static int decsubWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
out = hb_frame_buffer_init(AV_PIX_FMT_YUVA420P, w, h);
memset(out->data, 0, out->size);
- out->s.frametype = HB_FRAME_SUBTITLE;
- out->s.id = in->s.id;
- out->sequence = in->sequence;
- out->s.start = pts;
- out->s.stop = AV_NOPTS_VALUE;
- out->s.renderOffset = AV_NOPTS_VALUE;
- out->f.x = x0;
- out->f.y = y0;
+ out->s.frametype = HB_FRAME_SUBTITLE;
+ out->s.id = in->s.id;
+ out->sequence = in->sequence;
+ out->s.start = pts;
+ out->s.stop = AV_NOPTS_VALUE;
+ out->s.renderOffset = AV_NOPTS_VALUE;
+ out->f.x = x0;
+ out->f.y = y0;
+ out->f.window_width = pv->context->width;
+ out->f.window_height = pv->context->height;
for (ii = 0; ii < subtitle.num_rects; ii++)
{
AVSubtitleRect *rect = subtitle.rects[ii];