From 15aa5c37af71153316adcd7d56dbe7d12ad895c2 Mon Sep 17 00:00:00 2001 From: dynaflash Date: Tue, 4 May 2010 16:56:43 +0000 Subject: Universal Text Subtitle Support Initial Implementation - Patch by davidfstr ... Thanks! - Adds support for reading TEXT subtitle tracks from file inputs - Tested combinations: -- MKV UTF-8 -> MKV UTF-8 (passthru) -- MKV UTF-8 -> MP4 TX3G (upconvert) -- MP4 TX3G -> MKV UTF-8 (downconvert) -- MP4 TX3G -> MP4 TX3G (downconvert to UTF-8 then upconvert) - Further explained here http://forum.handbrake.fr/viewtopic.php?f=4&t=16099 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3283 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/work.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'libhb/work.c') diff --git a/libhb/work.c b/libhb/work.c index d2c8ac66b..838e50702 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -308,6 +308,8 @@ void hb_display_job_info( hb_job_t * job ) hb_log( " * subtitle track %i, %s (id %x) %s [%s] -> %s ", subtitle->track, subtitle->lang, subtitle->id, subtitle->format == PICTURESUB ? "Picture" : "Text", subtitle->source == VOBSUB ? "VOBSUB" : + subtitle->source == UTF8SUB ? "UTF-8" : + subtitle->source == TX3GSUB ? "TX3G" : ((subtitle->source == CC608SUB || subtitle->source == CC708SUB) ? "CC" : "SRT"), subtitle->config.dest == RENDERSUB ? "Render/Burn in" : "Pass-Through"); @@ -795,6 +797,25 @@ static void do_job( hb_job_t * job, int cpu_count ) w->subtitle = subtitle; hb_list_add( job->list_work, w ); } + + if( !job->indepth_scan && subtitle->source == UTF8SUB ) + { + w = hb_get_work( WORK_DECUTF8SUB ); + w->fifo_in = subtitle->fifo_in; + w->fifo_out = subtitle->fifo_raw; + hb_list_add( job->list_work, w ); + } + + if( !job->indepth_scan && subtitle->source == TX3GSUB ) + { + // TODO(davidfstr): For MP4 containers, an alternate work-object + // should be used that just passes the packets through, + // instead of downconverting to UTF-8 subtitles. + w = hb_get_work( WORK_DECTX3GSUB ); + w->fifo_in = subtitle->fifo_in; + w->fifo_out = subtitle->fifo_raw; + hb_list_add( job->list_work, w ); + } if( !job->indepth_scan && subtitle->format == PICTURESUB -- cgit v1.2.3