summaryrefslogtreecommitdiffstats
path: root/libhb/reader.c
diff options
context:
space:
mode:
authorjbrjake <[email protected]>2007-06-06 02:09:41 +0000
committerjbrjake <[email protected]>2007-06-06 02:09:41 +0000
commit98d438e568256d1815c374651c41090111b0db45 (patch)
tree61800965a9b315883e6eb2dfdc36909d588fcbfe /libhb/reader.c
parent1200c74a82f4715bc1d0651aeb4d39f6a3c9d449 (diff)
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
Diffstat (limited to 'libhb/reader.c')
-rw-r--r--libhb/reader.c24
1 files changed, 19 insertions, 5 deletions
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 );