diff options
author | John Stebbins <[email protected]> | 2019-01-07 10:52:28 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2019-01-14 13:36:08 -0800 |
commit | 1f52f52337028b977a83a0e1061b4cc36918c34f (patch) | |
tree | 7066a5ec5e4bc760ddfac69206eda40611bd7166 /libhb/muxavformat.c | |
parent | 31e676d288bb1be2f1d6096b26159ac92c7e143f (diff) |
ssa: improve SSA to TX3G conversion
We were only applying SSA inline override tags. With this patch we now
parse SSA style descritions in the SSA header and apply them per event.
Diffstat (limited to 'libhb/muxavformat.c')
-rw-r--r-- | libhb/muxavformat.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libhb/muxavformat.c b/libhb/muxavformat.c index 60eba066f..ff041b47c 100644 --- a/libhb/muxavformat.c +++ b/libhb/muxavformat.c @@ -13,6 +13,7 @@ #include "libavutil/intreadwrite.h" #include "hb.h" +#include "ssautil.h" #include "lang.h" struct hb_mux_data_s @@ -33,7 +34,8 @@ struct hb_mux_data_s int64_t prev_chapter_tc; int16_t current_chapter; - AVBSFContext * bitstream_context; + AVBSFContext * bitstream_context; + hb_tx3g_style_context_t * tx3g; }; struct hb_mux_object_s @@ -850,6 +852,8 @@ static int avformatInit( hb_mux_object_t * m ) if (job->mux == HB_MUX_AV_MP4) { track->st->codecpar->codec_id = AV_CODEC_ID_MOV_TEXT; + track->tx3g = hb_tx3g_style_init( + job->height, (char*)subtitle->extradata); } else { @@ -1344,8 +1348,8 @@ static int avformatMux(hb_mux_object_t *m, hb_mux_data_t *track, hb_buffer_t *bu * creating style atoms for them. */ hb_muxmp4_process_subtitle_style( - job->height, buf->data, &buffer, - &styleatom, &stylesize ); + track->tx3g, buf->data, &buffer, + &styleatom, &stylesize); if (buffer != NULL) { @@ -1453,6 +1457,10 @@ static int avformatEnd(hb_mux_object_t *m) { av_bsf_free(&m->tracks[ii]->bitstream_context); } + if (m->tracks[ii]->tx3g) + { + hb_tx3g_style_close(&m->tracks[ii]->tx3g); + } } if (job->chapter_markers) |