summaryrefslogtreecommitdiffstats
path: root/libhb/reader.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-06-03 14:46:04 +0000
committerjstebbins <[email protected]>2009-06-03 14:46:04 +0000
commitfa937f5aab19995d36ffbb59eb017d9428a5037f (patch)
tree5d69ec5db7af5d1c1a9023b1e26e699198ff916f /libhb/reader.c
parent30bf591dfa913e1524b9789cd5fae829ad494d00 (diff)
softsubs: allow 1 source to many output subs by duplicating the
subtitle buffer where necessary git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2475 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/reader.c')
-rw-r--r--libhb/reader.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/libhb/reader.c b/libhb/reader.c
index 9ac515c4e..ad0fe64dd 100644
--- a/libhb/reader.c
+++ b/libhb/reader.c
@@ -501,8 +501,8 @@ static hb_fifo_t ** GetFifoForId( hb_job_t * job, int id )
hb_title_t * title = job->title;
hb_audio_t * audio;
hb_subtitle_t * subtitle;
- int i, n;
- static hb_fifo_t * fifos[8];
+ int i, n, count;
+ static hb_fifo_t * fifos[100];
memset(fifos, 0, sizeof(fifos));
@@ -523,7 +523,10 @@ static hb_fifo_t ** GetFifoForId( hb_job_t * job, int id )
}
}
- for( i=0; i < hb_list_count( title->list_subtitle ); i++ ) {
+ n = 0;
+ count = hb_list_count( title->list_subtitle );
+ count = count > 99 ? 99 : count;
+ for( i=0; i < count; i++ ) {
subtitle = hb_list_item( title->list_subtitle, i );
if (id == subtitle->id) {
subtitle->hits++;
@@ -534,12 +537,14 @@ static hb_fifo_t ** GetFifoForId( hb_job_t * job, int id )
* we are scanning and looking for forced subs, then pass them up
* to decode whether the sub is a forced one.
*/
- fifos[0] = subtitle->fifo_in;
- return fifos;
+ fifos[n++] = subtitle->fifo_in;
}
- break;
}
}
+ if ( n != 0 )
+ {
+ return fifos;
+ }
if( !job->indepth_scan )
{