diff options
author | jstebbins <[email protected]> | 2010-09-28 22:10:49 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-09-28 22:10:49 +0000 |
commit | 03b2ce0e91c4e4ed44445a075ef5f35bc052b5b8 (patch) | |
tree | 24a1def4ca91cba98676508c6a3b1482ba131cb5 /libhb/encavcodec.c | |
parent | f1997be4ed1dd373316ac842685f18a6f8ab05ba (diff) |
SSA subtitle burn in
Anime fans rejoice! This patch adds SSA subtitle burn-in support with libass.
Therefore SSA subtitles should now be rendered in full quality, with the
appropriate embedded fonts and positioning information.
Thanks to davidfstr
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3557 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encavcodec.c')
-rw-r--r-- | libhb/encavcodec.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/libhb/encavcodec.c b/libhb/encavcodec.c index 22eb286d5..5ae5a3929 100644 --- a/libhb/encavcodec.c +++ b/libhb/encavcodec.c @@ -235,13 +235,22 @@ int encavcodecWork( hb_work_object_t * w, hb_buffer_t ** buf_in, // doesn't do the trick. It must be set in the AVFrame. frame->quality = pv->context->global_quality; - /* Should be way too large */ - buf = hb_video_buffer_init( job->width, job->height ); - buf->size = avcodec_encode_video( pv->context, buf->data, buf->alloc, - frame ); - buf->start = in->start; - buf->stop = in->stop; - buf->frametype = pv->context->coded_frame->key_frame ? HB_FRAME_KEY : HB_FRAME_REF; + if ( pv->context->codec ) + { + /* Should be way too large */ + buf = hb_video_buffer_init( job->width, job->height ); + buf->size = avcodec_encode_video( pv->context, buf->data, buf->alloc, + frame ); + buf->start = in->start; + buf->stop = in->stop; + buf->frametype = pv->context->coded_frame->key_frame ? HB_FRAME_KEY : HB_FRAME_REF; + } + else + { + buf = NULL; + + hb_error( "encavcodec: codec context has uninitialized codec; skipping frame" ); + } av_free( frame ); |