diff options
author | John Stebbins <[email protected]> | 2017-11-03 11:10:02 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2017-11-03 11:10:02 -0700 |
commit | 4fd607b633edafd72efef57231928c8c9cbfae28 (patch) | |
tree | 31f077a7bf6f577649bb3ad988abec199d553ee6 /libhb/muxavformat.c | |
parent | 60d0111324fc8d8014784e0a2af36c0fc26f694c (diff) |
tx3g: make font size scale with video height
Fixes https://forum.handbrake.fr/viewtopic.php?f=5&t=37034
Diffstat (limited to 'libhb/muxavformat.c')
-rw-r--r-- | libhb/muxavformat.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c index cad3c09de..f011c0cee 100644 --- a/libhb/muxavformat.c +++ b/libhb/muxavformat.c @@ -831,9 +831,20 @@ static int avformatInit( hb_mux_object_t * m ) 'A','r','i','a','l' // Font name }; - int width, height = 60; - width = job->width * job->par.num / job->par.den; - track->st->codecpar->width = width; + int width, height, font_size; + width = job->width * job->par.num / job->par.den; + font_size = 0.05 * job->height; + if (font_size < 12) + { + font_size = 12; + } + else if (font_size > 255) + { + font_size = 255; + } + properties[25] = font_size; + height = 3 * font_size; + track->st->codecpar->width = width; track->st->codecpar->height = height; properties[14] = height >> 8; properties[15] = height & 0xff; @@ -1258,8 +1269,9 @@ static int avformatMux(hb_mux_object_t *m, hb_mux_data_t *track, hb_buffer_t *bu * Copy the subtitle into buffer stripping markup and * creating style atoms for them. */ - hb_muxmp4_process_subtitle_style(buf->data, &buffer, - &styleatom, &stylesize ); + hb_muxmp4_process_subtitle_style( + job->height, buf->data, &buffer, + &styleatom, &stylesize ); if (buffer != NULL) { |