diff options
author | jstebbins <[email protected]> | 2015-03-29 16:22:30 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2015-03-29 16:22:30 +0000 |
commit | 8e9bff8f32423c3ac69986bb3e4d03300d41dd4e (patch) | |
tree | a31260ce3ac5fc295f93f48ca2f7136563aa4455 /libhb/scan.c | |
parent | 168ce686fd837de7fbf20266df31af2ac00c8db1 (diff) |
libhb: Eliminate global variable hb_gui_use_hwd_flag
This global was shared between the CLI and libhb and used as a back door to
force scan and encode passes to use the same ffmpeg context for hardware
decoding. Aside from the fact that this context sharing should not be necessary
and needs fixing, this information belongs in the hb_handle_t that is shared
between the scan and the encode. So put it there and make sure the hb_handle_t
get propagated to where the flag is needed.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7028 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/scan.c')
-rw-r--r-- | libhb/scan.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libhb/scan.c b/libhb/scan.c index 32a5c60bb..1ab175765 100644 --- a/libhb/scan.c +++ b/libhb/scan.c @@ -29,14 +29,13 @@ typedef struct int store_previews; uint64_t min_title_duration; - } hb_scan_t; #define PREVIEW_READ_THRESH (1024 * 1024 * 10) static void ScanFunc( void * ); static int DecodePreviews( hb_scan_t *, hb_title_t * title, int flush ); -static void LookForAudio( hb_title_t * title, hb_buffer_t * b ); +static void LookForAudio(hb_scan_t *scan, hb_title_t *title, hb_buffer_t *b); static int AllAudioOK( hb_title_t * title ); static void UpdateState1(hb_scan_t *scan, int title); static void UpdateState2(hb_scan_t *scan, int title); @@ -102,7 +101,7 @@ static void ScanFunc( void * _data ) data->stream = NULL; /* Try to open the path as a DVD. If it fails, try as a file */ - if( ( data->bd = hb_bd_init( data->path ) ) ) + if( ( data->bd = hb_bd_init( data->h, data->path ) ) ) { hb_log( "scan: BD has %d title(s)", hb_bd_title_count( data->bd ) ); @@ -152,12 +151,12 @@ static void ScanFunc( void * _data ) data->title_set->list_title ); } } - else if ( ( data->batch = hb_batch_init( data->path ) ) ) + else if ( ( data->batch = hb_batch_init( data->h, data->path ) ) ) { if( data->title_index ) { /* Scan this title only */ - title = hb_batch_title_scan( data->batch, data->title_index ); + title = hb_batch_title_scan(data->batch, data->title_index); if ( title ) { hb_list_add( data->title_set->list_title, title ); @@ -171,7 +170,7 @@ static void ScanFunc( void * _data ) hb_title_t * title; UpdateState1(data, i + 1); - title = hb_batch_title_scan( data->batch, i + 1 ); + title = hb_batch_title_scan(data->batch, i + 1); if ( title != NULL ) { hb_list_add( data->title_set->list_title, title ); @@ -190,7 +189,8 @@ static void ScanFunc( void * _data ) if (data->title_index == 0) data->title_index = 1; hb_title_t * title = hb_title_init( data->path, data->title_index ); - if ( (data->stream = hb_stream_open( data->path, title, 1 ) ) != NULL ) + data->stream = hb_stream_open(data->h, data->path, title, 1); + if (data->stream != NULL) { title = hb_stream_title_scan( data->stream, title ); if ( title ) @@ -545,11 +545,11 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title, int flush ) } else if (data->batch) { - stream = hb_stream_open( title->path, title, 0 ); + stream = hb_stream_open(data->h, title->path, title, 0); } else if (data->stream) { - stream = hb_stream_open( data->path, title, 0 ); + stream = hb_stream_open(data->h, data->path, title, 0); } if (title->video_codec == WORK_NONE) @@ -557,7 +557,7 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title, int flush ) hb_error("No video decoder set!"); return 0; } - hb_work_object_t *vid_decoder = hb_get_work(title->video_codec); + hb_work_object_t *vid_decoder = hb_get_work(data->h, title->video_codec); vid_decoder->codec_param = title->video_codec_param; vid_decoder->title = title; vid_decoder->init( vid_decoder, NULL ); @@ -734,7 +734,7 @@ static int DecodePreviews( hb_scan_t * data, hb_title_t * title, int flush ) } else if( ! AllAudioOK( title ) ) { - LookForAudio( title, buf_es ); + LookForAudio( data, title, buf_es ); buf_es = NULL; } if ( buf_es ) @@ -1072,7 +1072,7 @@ skip_preview: * aren't (e.g., some European DVD Teletext streams use the same IDs as US ATSC * AC-3 audio). */ -static void LookForAudio( hb_title_t * title, hb_buffer_t * b ) +static void LookForAudio(hb_scan_t *scan, hb_title_t * title, hb_buffer_t * b) { int i; @@ -1108,7 +1108,7 @@ static void LookForAudio( hb_title_t * title, hb_buffer_t * b ) } hb_fifo_push( audio->priv.scan_cache, b ); - hb_work_object_t *w = hb_codec_decoder( audio->config.in.codec ); + hb_work_object_t *w = hb_codec_decoder(scan->h, audio->config.in.codec); if ( w == NULL || w->bsinfo == NULL ) { |