From 98d438e568256d1815c374651c41090111b0db45 Mon Sep 17 00:00:00 2001 From: jbrjake Date: Wed, 6 Jun 2007 02:09:41 +0000 Subject: A big batch of patches from eddyg. Adds following options to the CLI: --subtitle-scan for auto-selecting subtitles for foreign language segments in native language audio tracks --native-language for auto-selecting subtitles for foreign language audio without knowing the track number --longest for auto-selecting the longest title like in the MacGui --turbo for improving speed on the first pass of a two pass encode with x264 (based on superdump's turbo x264 options in mencoder). Thanks, eddyg! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@600 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/reader.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'libhb/reader.c') diff --git a/libhb/reader.c b/libhb/reader.c index 35939f96b..4767f87a7 100644 --- a/libhb/reader.c +++ b/libhb/reader.c @@ -138,12 +138,26 @@ static hb_fifo_t * GetFifoForId( hb_job_t * job, int id ) return job->fifo_mpeg2; } - if( ( subtitle = hb_list_item( title->list_subtitle, 0 ) ) && - id == subtitle->id ) - { - return subtitle->fifo_in; + if (job->subtitle_scan) { + /* + * Count the occurances of the subtitles, don't actually return any to encode. + */ + for (i=0; i < hb_list_count(title->list_subtitle); i++) { + subtitle = hb_list_item( title->list_subtitle, i); + if (id == subtitle->id) { + /* + * A hit, count it. + */ + subtitle->hits++; + } + } + } else { + if( ( subtitle = hb_list_item( title->list_subtitle, 0 ) ) && + id == subtitle->id ) + { + return subtitle->fifo_in; + } } - for( i = 0; i < hb_list_count( title->list_audio ); i++ ) { audio = hb_list_item( title->list_audio, i ); -- cgit v1.2.3