diff options
author | jstebbins <[email protected]> | 2010-09-15 16:34:22 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-09-15 16:34:22 +0000 |
commit | 60f853bbbbee88da9cc9aa24b21705242b6157eb (patch) | |
tree | 67b0b137f750cc2b940577a7c7a38a64e41769cb /libhb/scan.c | |
parent | be3a03fca39d47d391efa36894124fc2e87eb5de (diff) |
fix cli issue with batch scan and encode
I didn't implement 'single title scan' for batch mode cause it seemed
contradictory. but the cli uses this when encoding, even in batch mode.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3530 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/scan.c')
-rw-r--r-- | libhb/scan.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/libhb/scan.c b/libhb/scan.c index 1bbb241e9..445314bcd 100644 --- a/libhb/scan.c +++ b/libhb/scan.c @@ -124,20 +124,29 @@ static void ScanFunc( void * _data ) } else if ( ( data->batch = hb_batch_init( data->path ) ) ) { - int j = 1; - - /* Scan all titles */ - for( i = 0; i < hb_batch_title_count( data->batch ); i++ ) + if( data->title_index ) { - hb_title_t * title; - - title = hb_batch_title_scan( data->batch, i ); - if ( title != NULL ) + /* Scan this title only */ + title = hb_batch_title_scan( data->batch, data->title_index ); + if ( title ) { - title->index = j++; hb_list_add( data->list_title, title ); } } + else + { + /* Scan all titles */ + for( i = 0; i < hb_batch_title_count( data->batch ); i++ ) + { + hb_title_t * title; + + title = hb_batch_title_scan( data->batch, i + 1 ); + if ( title != NULL ) + { + hb_list_add( data->list_title, title ); + } + } + } } else if ( (data->stream = hb_stream_open( data->path, 0 ) ) != NULL ) { |