summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-11-25 21:54:06 +0000
committerjstebbins <[email protected]>2009-11-25 21:54:06 +0000
commit4bff40cd0865f37bbc8680883e1db0e22d9247c7 (patch)
tree2ae1de6844ef0c965f2ffabdad3e33a0546035ef /libhb
parent1ad5c0f4f6295306828d179b68bfc6756a0a9d26 (diff)
fix title index issue in batch scanning
title index was assigned as the nth file in the directory, but files that are not video would cause title indexes to be skipped in job.list_title this would mess up the progress bar. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2982 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/batch.c5
-rw-r--r--libhb/scan.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/libhb/batch.c b/libhb/batch.c
index f627df555..28c40ca48 100644
--- a/libhb/batch.c
+++ b/libhb/batch.c
@@ -87,10 +87,10 @@ hb_title_t * hb_batch_title_scan( hb_batch_t * d, int t )
char * filename;
hb_stream_t * stream;
- if ( t < 1 )
+ if ( t < 0 )
return NULL;
- filename = hb_list_item( d->list_file, t-1 );
+ filename = hb_list_item( d->list_file, t );
if ( filename == NULL )
return NULL;
@@ -99,7 +99,6 @@ hb_title_t * hb_batch_title_scan( hb_batch_t * d, int t )
return NULL;
title = hb_stream_title_scan( stream );
- title->index = t;
hb_stream_close( &stream );
return title;
diff --git a/libhb/scan.c b/libhb/scan.c
index ea15fc512..66afb2a21 100644
--- a/libhb/scan.c
+++ b/libhb/scan.c
@@ -97,14 +97,17 @@ 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++ )
{
hb_title_t * title;
- title = hb_batch_title_scan( data->batch, i + 1 );
+ title = hb_batch_title_scan( data->batch, i );
if ( title != NULL )
{
+ title->index = j++;
hb_list_add( data->list_title, title );
}
}