From 7d290195368d5229066e2516d597928dd7315514 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Wed, 18 May 2016 09:31:05 -0600 Subject: work: don't allocate fifos that are not needed for indepth_scan --- libhb/work.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'libhb/work.c') diff --git a/libhb/work.c b/libhb/work.c index 0d971f32f..87ab19f83 100644 --- a/libhb/work.c +++ b/libhb/work.c @@ -1494,18 +1494,24 @@ static void do_job(hb_job_t *job) { job->fifo_mpeg2 = hb_fifo_init( FIFO_MINI, FIFO_MINI_WAKE ); job->fifo_raw = hb_fifo_init( FIFO_MINI, FIFO_MINI_WAKE ); - job->fifo_sync = hb_fifo_init( FIFO_MINI, FIFO_MINI_WAKE ); - job->fifo_render = hb_fifo_init( FIFO_MINI, FIFO_MINI_WAKE ); - job->fifo_mpeg4 = hb_fifo_init( FIFO_MINI, FIFO_MINI_WAKE ); + if (!job->indepth_scan) + { + job->fifo_sync = hb_fifo_init( FIFO_MINI, FIFO_MINI_WAKE ); + job->fifo_render = hb_fifo_init( FIFO_MINI, FIFO_MINI_WAKE ); + job->fifo_mpeg4 = hb_fifo_init( FIFO_MINI, FIFO_MINI_WAKE ); + } } else #endif { job->fifo_mpeg2 = hb_fifo_init( FIFO_LARGE, FIFO_LARGE_WAKE ); job->fifo_raw = hb_fifo_init( FIFO_SMALL, FIFO_SMALL_WAKE ); - job->fifo_sync = hb_fifo_init( FIFO_SMALL, FIFO_SMALL_WAKE ); - job->fifo_mpeg4 = hb_fifo_init( FIFO_LARGE, FIFO_LARGE_WAKE ); - job->fifo_render = NULL; // Attached to filter chain + if (!job->indepth_scan) + { + job->fifo_sync = hb_fifo_init( FIFO_SMALL, FIFO_SMALL_WAKE ); + job->fifo_render = NULL; // Attached to filter chain + job->fifo_mpeg4 = hb_fifo_init( FIFO_LARGE, FIFO_LARGE_WAKE ); + } } result = sanitize_audio(job); @@ -1525,10 +1531,10 @@ static void do_job(hb_job_t *job) audio = hb_list_item(job->list_audio, i); /* set up the audio work fifos */ + audio->priv.fifo_in = hb_fifo_init(FIFO_LARGE, FIFO_LARGE_WAKE); audio->priv.fifo_raw = hb_fifo_init(FIFO_SMALL, FIFO_SMALL_WAKE); audio->priv.fifo_sync = hb_fifo_init(FIFO_SMALL, FIFO_SMALL_WAKE); audio->priv.fifo_out = hb_fifo_init(FIFO_LARGE, FIFO_LARGE_WAKE); - audio->priv.fifo_in = hb_fifo_init(FIFO_LARGE, FIFO_LARGE_WAKE); // Add audio decoder work object w = hb_audio_decoder(job->h, audio->config.in.codec); @@ -1573,9 +1579,12 @@ static void do_job(hb_job_t *job) { // decsrtsub is a buffer source like reader. It's input comes // from a file. - subtitle->fifo_in = hb_fifo_init( FIFO_SMALL, FIFO_SMALL_WAKE ); + subtitle->fifo_in = hb_fifo_init( FIFO_SMALL, FIFO_SMALL_WAKE ); + } + if (!job->indepth_scan) + { + subtitle->fifo_out = hb_fifo_init( FIFO_SMALL, FIFO_SMALL_WAKE ); } - subtitle->fifo_out = hb_fifo_init( FIFO_SMALL, FIFO_SMALL_WAKE ); w->fifo_in = subtitle->fifo_in; w->fifo_out = subtitle->fifo_raw; -- cgit v1.2.3