summaryrefslogtreecommitdiffstats
path: root/libhb/reader.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2012-05-01 13:53:12 +0000
committerRodeo <[email protected]>2012-05-01 13:53:12 +0000
commit9eb8646ec2f9a8167c93aae08d55533d8a5984a3 (patch)
treeba322cf1fdbfb5eda27d7f24402fdca98eafcbf5 /libhb/reader.c
parentdf3daf7cdd85794ef3d7f0eff181eb3b323a489f (diff)
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
Diffstat (limited to 'libhb/reader.c')
-rw-r--r--libhb/reader.c22
1 files changed, 7 insertions, 15 deletions
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 )