summaryrefslogtreecommitdiffstats
path: root/libhb/work.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-06-13 18:13:53 +0000
committerjstebbins <[email protected]>2009-06-13 18:13:53 +0000
commit287e7975364684cf7d3fdbb4c10fbdb94e03b751 (patch)
tree005015145baec721417e668e4b91c0401150d125 /libhb/work.c
parent4779df6821d2be09a9b02f28f6f4adedbc82560f (diff)
dvdnav: oops. initialize d->chapter to 0 instead of first chapter
otherwise, we don't get the initial chapter marker event git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2528 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/work.c')
-rw-r--r--libhb/work.c51
1 files changed, 22 insertions, 29 deletions
diff --git a/libhb/work.c b/libhb/work.c
index 7ffb3ab3b..4f2050224 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -382,6 +382,7 @@ static void do_job( hb_job_t * job, int cpu_count )
hb_title_t * title;
int i, j;
hb_work_object_t * w;
+ hb_interjob_t * interjob;
hb_audio_t * audio;
hb_subtitle_t * subtitle;
@@ -393,6 +394,7 @@ static void do_job( hb_job_t * job, int cpu_count )
unsigned int subtitle_hit = 0;
title = job->title;
+ interjob = hb_interjob_get( job->h );
if( job->pass == 2 && !job->cfr )
{
@@ -505,7 +507,8 @@ static void do_job( hb_job_t * job, int cpu_count )
/*
* Look for the scanned subtitle in the existing subtitle list
*/
- if ( !job->indepth_scan && job->select_subtitle && *(job->select_subtitle) )
+ if ( !job->indepth_scan && interjob->select_subtitle &&
+ ( job->pass == 0 || job->pass == 2 ) )
{
/*
* Disable forced subtitles if we didn't find any in the scan
@@ -513,10 +516,10 @@ static void do_job( hb_job_t * job, int cpu_count )
*
* select_subtitle implies that we did a scan.
*/
- if( (*job->select_subtitle)->config.force &&
- (*job->select_subtitle)->forced_hits == 0 )
+ if( interjob->select_subtitle->config.force &&
+ interjob->select_subtitle->forced_hits == 0 )
{
- (*job->select_subtitle)->config.force = 0;
+ interjob->select_subtitle->config.force = 0;
}
for( i=0; i < hb_list_count(title->list_subtitle); i++ )
{
@@ -530,17 +533,16 @@ static void do_job( hb_job_t * job, int cpu_count )
*
* select_subtitle implies that we did a scan.
*/
- if( (*job->select_subtitle)->id == subtitle->id )
+ if( interjob->select_subtitle->id == subtitle->id )
{
- *subtitle = *(*job->select_subtitle);
- free( *job->select_subtitle );
- free( job->select_subtitle );
- job->select_subtitle = NULL;
+ *subtitle = *(interjob->select_subtitle);
+ free( interjob->select_subtitle );
+ interjob->select_subtitle = NULL;
}
}
}
- if( job->select_subtitle )
+ if( interjob->select_subtitle )
{
/*
* Its not in the existing list
@@ -549,16 +551,10 @@ static void do_job( hb_job_t * job, int cpu_count )
* add the subtitle that we found on the first pass for use in this
* pass.
*/
- hb_list_add( title->list_subtitle, *job->select_subtitle );
- free( job->select_subtitle );
- job->select_subtitle = NULL;
+ hb_list_add( title->list_subtitle, interjob->select_subtitle );
+ interjob->select_subtitle = NULL;
}
}
- else if ( !job->indepth_scan && job->select_subtitle )
- {
- free( job->select_subtitle );
- job->select_subtitle = NULL;
- }
for( i=0; i < hb_list_count(title->list_subtitle); i++ )
@@ -1045,20 +1041,17 @@ cleanup:
}
}
- if( job->select_subtitle )
+ if( job->indepth_scan )
{
- if( job->indepth_scan )
+ for( i=0; i < hb_list_count( title->list_subtitle ); i++ )
{
- for( i=0; i < hb_list_count( title->list_subtitle ); i++ )
+ subtitle = hb_list_item( title->list_subtitle, i );
+ if( subtitle->id == subtitle_hit )
{
- subtitle = hb_list_item( title->list_subtitle, i );
- if( subtitle->id == subtitle_hit )
- {
- subtitle->config = job->select_subtitle_config;
- hb_list_rem( title->list_subtitle, subtitle );
- *job->select_subtitle = subtitle;
- break;
- }
+ subtitle->config = job->select_subtitle_config;
+ hb_list_rem( title->list_subtitle, subtitle );
+ interjob->select_subtitle = subtitle;
+ break;
}
}
}