- 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 unless we are looking fro forced
+ * subtitles in which case we need to look in the sub picture
+ * to see if it has the forced flag enabled.
+ */
+ 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++;
+ if( job->subtitle_force )
+ {
+ return subtitle->fifo_in;
+ }
+ break;
+ }
+ }
+ } else {
+ if( ( subtitle = hb_list_item( title->list_subtitle, 0 ) ) &&
+ id == subtitle->id )
+ {
+ return subtitle->fifo_in;
+ }