From 9eb8646ec2f9a8167c93aae08d55533d8a5984a3 Mon Sep 17 00:00:00 2001 From: Rodeo Date: Tue, 1 May 2012 13:53:12 +0000 Subject: Simplify Foreign Audio Search code: - move all subtitle hit counting to the decoders instead of reader ---> allows us to count actual subtitles rather than just packets - always count subtitles, even when not doing a scan (may be useful in the future) Miscellaneous improvements: - always insert select_subtitle at the head of the output subtitle list, to make it less likely to be dropped - when multiple subtitle tracks have forced hits, pick the track with the fewest forced hits ---> Foreign Audio Search should now work with Star Wars on Blu-ray - logging improvements (more readable, and log job->select_subtitle configuration - Forced Only vs. All, Render vs. Passthrough) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4622 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/reader.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'libhb/reader.c') diff --git a/libhb/reader.c b/libhb/reader.c index 40756bc67..1807c0aac 100644 --- a/libhb/reader.c +++ b/libhb/reader.c @@ -741,22 +741,15 @@ static hb_fifo_t ** GetFifoForId( hb_job_t * job, int id ) } } - n = 0; count = hb_list_count( title->list_subtitle ); count = count > 99 ? 99 : count; - for( i=0; i < count; i++ ) { + for( i = n = 0; i < count; i++ ) + { subtitle = hb_list_item( title->list_subtitle, i ); - if (id == subtitle->id) { - subtitle->hits++; - if( !job->indepth_scan || job->select_subtitle_config.force ) - { - /* - * Pass the subtitles to be processed if we are not scanning, or if - * we are scanning and looking for forced subs, then pass them up - * to decode whether the sub is a forced one. - */ - fifos[n++] = subtitle->fifo_in; - } + if (id == subtitle->id) + { + /* pass the subtitles to be processed */ + fifos[n++] = subtitle->fifo_in; } } if ( n != 0 ) @@ -766,8 +759,7 @@ static hb_fifo_t ** GetFifoForId( hb_job_t * job, int id ) if( !job->indepth_scan ) { - n = 0; - for( i = 0; i < hb_list_count( title->list_audio ); i++ ) + for( i = n = 0; i < hb_list_count( title->list_audio ); i++ ) { audio = hb_list_item( title->list_audio, i ); if( id == audio->id ) -- cgit v1.2.3