- 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
- * so that we display normal subtitles instead.
- *
- * select_subtitle implies that we did a scan.
- */
- if( interjob->select_subtitle->config.force &&
- interjob->select_subtitle->forced_hits == 0 )
- {
- interjob->select_subtitle->config.force = 0;
- }
- for( i=0; i < hb_list_count(title->list_subtitle); i++ )
- {
- subtitle = hb_list_item( title->list_subtitle, i );
-
- if( subtitle )
- {
- /*
- * Disable forced subtitles if we didn't find any in the scan
- * so that we display normal subtitles instead.
- *
- * select_subtitle implies that we did a scan.
- */
- if( interjob->select_subtitle->id == subtitle->id )
- {
- *subtitle = *(interjob->select_subtitle);
- free( interjob->select_subtitle );
- interjob->select_subtitle = NULL;
- }
- }
- }
-
- if( interjob->select_subtitle )
- {
- /*
- * Its not in the existing list
- *
- * Must be second pass of a two pass with subtitle scan enabled, so
- * add the subtitle that we found on the first pass for use in this
- * pass.
- */
- hb_list_add( title->list_subtitle, interjob->select_subtitle );
- interjob->select_subtitle = NULL;
- }
- }
-
-
- for( i=0; i < hb_list_count(title->list_subtitle); i++ )
- {
- subtitle = hb_list_item( title->list_subtitle, i );
-
- if( subtitle )
- {
- subtitle->fifo_in = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
- subtitle->fifo_raw = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
- subtitle->fifo_sync = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
- subtitle->fifo_out = hb_fifo_init( FIFO_CPU_MULT * cpu_count );
-
- if( (!job->indepth_scan || job->select_subtitle_config.force) &&
- subtitle->source == VOBSUB ) {
- /*
- * Don't add threads for subtitles when we are scanning, unless
- * looking for forced subtitles.
- */
- w = hb_get_work( WORK_DECVOBSUB );
- w->fifo_in = subtitle->fifo_in;
- w->fifo_out = subtitle->fifo_raw;
- w->subtitle = subtitle;
- hb_list_add( job->list_work, w );
- }
-
- if( !job->indepth_scan && subtitle->source == CC608SUB )
- {
- w = hb_get_work( WORK_DECCC608 );
- w->fifo_in = subtitle->fifo_in;
- w->fifo_out = subtitle->fifo_raw;
- hb_list_add( job->list_work, w );
- }
-
- if( !job->indepth_scan && subtitle->source == SRTSUB )
- {
- w = hb_get_work( WORK_DECSRTSUB );
- w->fifo_in = subtitle->fifo_in;
- w->fifo_out = subtitle->fifo_raw;
- w->subtitle = subtitle;
- hb_list_add( job->list_work, w );
- }
-
- if( !job->indepth_scan &&
- subtitle->format == PICTURESUB
- && subtitle->config.dest == PASSTHRUSUB )
- {
- /*
- * Passing through a subtitle picture, this will have to
- * be rle encoded before muxing.
- */
- w = hb_get_work( WORK_ENCVOBSUB );
- w->fifo_in = subtitle->fifo_sync;
- w->fifo_out = subtitle->fifo_out;
- w->subtitle = subtitle;
- hb_list_add( job->list_work, w );
- }
- }
- }
-