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
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;
return NULL;
title = hb_stream_title_scan( stream );
- title->index = t;
hb_stream_close( &stream );
return title;
}
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 );
}
}