diff options
Diffstat (limited to 'libhb/deccc608sub.c')
-rw-r--r-- | libhb/deccc608sub.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/libhb/deccc608sub.c b/libhb/deccc608sub.c index 27b7e23b0..10d9926d9 100644 --- a/libhb/deccc608sub.c +++ b/libhb/deccc608sub.c @@ -1789,23 +1789,28 @@ static int decccInit( hb_work_object_t * w, hb_job_t * job ) { retval = 1; } - init_eia608(pv->cc608->data608); + else + { + init_eia608(pv->cc608->data608); + } } + + // When rendering subs, we need to push rollup subtitles out + // asap (instead of waiting for a completed line) so that we + // do not miss the frame that they should be rendered over. + pv->cc608->direct_rollup = w->subtitle->config.dest == RENDERSUB; + } + + if (!retval) + { + // Generate generic SSA Script Info. + int height = job->title->geometry.height - job->crop[0] - job->crop[1]; + int width = job->title->geometry.width - job->crop[2] - job->crop[3]; + int safe_height = 0.8 * job->title->geometry.height; + hb_subtitle_add_ssa_header(w->subtitle, HB_FONT_MONO, + .08 * safe_height, width, height); } } - if (!retval) - { - // Generate generic SSA Script Info. - int height = job->title->geometry.height - job->crop[0] - job->crop[1]; - int width = job->title->geometry.width - job->crop[2] - job->crop[3]; - int safe_height = 0.8 * job->title->geometry.height; - hb_subtitle_add_ssa_header(w->subtitle, HB_FONT_MONO, - .08 * safe_height, width, height); - } - // When rendering subs, we need to push rollup subtitles out - // asap (instead of waiting for a completed line) so that we - // do not miss the frame that they should be rendered over. - pv->cc608->direct_rollup = w->subtitle->config.dest == RENDERSUB; return retval; } @@ -1842,9 +1847,13 @@ static int decccWork( hb_work_object_t * w, hb_buffer_t ** buf_in, static void decccClose( hb_work_object_t * w ) { hb_work_private_t * pv = w->private_data; - general_608_close( pv->cc608 ); - free( pv->cc608->data608 ); - free( pv->cc608 ); + + if (pv) + { + general_608_close( pv->cc608 ); + free( pv->cc608->data608 ); + free( pv->cc608 ); + } free( w->private_data ); } |