diff options
Diffstat (limited to 'libhb/reader.c')
-rw-r--r-- | libhb/reader.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/libhb/reader.c b/libhb/reader.c index 2084a7f79..93ba869e6 100644 --- a/libhb/reader.c +++ b/libhb/reader.c @@ -54,12 +54,13 @@ struct hb_work_private_s int start_found; // found pts_to_start point int64_t pts_to_start; uint64_t st_first; + hb_fifo_t * fifos[100]; }; /*********************************************************************** * Local prototypes **********************************************************************/ -static hb_fifo_t ** GetFifoForId( hb_job_t * job, int id ); +static hb_fifo_t ** GetFifoForId( hb_work_private_t * r, int id ); static void UpdateState( hb_work_private_t * r, int64_t start); /*********************************************************************** @@ -528,7 +529,7 @@ void ReadLoop( void * _w ) while( ( buf = hb_list_item( list, 0 ) ) ) { hb_list_rem( list, buf ); - fifos = GetFifoForId( r->job, buf->s.id ); + fifos = GetFifoForId( r, buf->s.id ); if ( fifos && ! r->saw_video && !r->job->indepth_scan ) { @@ -716,15 +717,15 @@ static void UpdateState( hb_work_private_t * r, int64_t start) *********************************************************************** * **********************************************************************/ -static hb_fifo_t ** GetFifoForId( hb_job_t * job, int id ) +static hb_fifo_t ** GetFifoForId( hb_work_private_t * r, int id ) { + hb_job_t * job = r->job; hb_title_t * title = job->title; hb_audio_t * audio; hb_subtitle_t * subtitle; int i, n, count; - static hb_fifo_t * fifos[100]; - memset(fifos, 0, sizeof(fifos)); + memset(r->fifos, 0, sizeof(r->fifos)); if( id == title->video_id ) { @@ -738,8 +739,8 @@ static hb_fifo_t ** GetFifoForId( hb_job_t * job, int id ) } else { - fifos[0] = job->fifo_mpeg2; - return fifos; + r->fifos[0] = job->fifo_mpeg2; + return r->fifos; } } @@ -751,12 +752,12 @@ static hb_fifo_t ** GetFifoForId( hb_job_t * job, int id ) if (id == subtitle->id) { /* pass the subtitles to be processed */ - fifos[n++] = subtitle->fifo_in; + r->fifos[n++] = subtitle->fifo_in; } } if ( n != 0 ) { - return fifos; + return r->fifos; } if( !job->indepth_scan ) @@ -766,13 +767,13 @@ static hb_fifo_t ** GetFifoForId( hb_job_t * job, int id ) audio = hb_list_item( title->list_audio, i ); if( id == audio->id ) { - fifos[n++] = audio->priv.fifo_in; + r->fifos[n++] = audio->priv.fifo_in; } } if( n != 0 ) { - return fifos; + return r->fifos; } } |