summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libhb/batch.c7
-rw-r--r--libhb/internal.h3
-rw-r--r--libhb/scan.c5
3 files changed, 11 insertions, 4 deletions
diff --git a/libhb/batch.c b/libhb/batch.c
index 37e626ce7..cc7808e6c 100644
--- a/libhb/batch.c
+++ b/libhb/batch.c
@@ -114,7 +114,7 @@ int hb_batch_title_count( hb_batch_t * d )
/***********************************************************************
* hb_batch_title_scan
**********************************************************************/
-hb_title_t * hb_batch_title_scan( hb_batch_t * d, int t )
+hb_title_t * hb_batch_title_scan( hb_batch_t * d, int t, uint64_t min_duration )
{
hb_title_t * title;
@@ -139,6 +139,11 @@ hb_title_t * hb_batch_title_scan( hb_batch_t * d, int t )
title = hb_stream_title_scan( stream, title );
hb_stream_close( &stream );
+ if( title->duration < min_duration )
+ {
+ hb_log( "batch: ignoring title (too short)" );
+ hb_title_close(&title);
+ }
return title;
}
diff --git a/libhb/internal.h b/libhb/internal.h
index 1e79447f8..b41bc29ed 100644
--- a/libhb/internal.h
+++ b/libhb/internal.h
@@ -309,7 +309,8 @@ typedef struct hb_batch_s hb_batch_t;
hb_batch_t * hb_batch_init( hb_handle_t *h, char * path );
void hb_batch_close( hb_batch_t ** _d );
int hb_batch_title_count( hb_batch_t * d );
-hb_title_t * hb_batch_title_scan( hb_batch_t * d, int t );
+hb_title_t * hb_batch_title_scan( hb_batch_t * d, int t,
+ uint64_t min_duration );
/***********************************************************************
* dvd.c
diff --git a/libhb/scan.c b/libhb/scan.c
index da7379c0f..663ddc6f1 100644
--- a/libhb/scan.c
+++ b/libhb/scan.c
@@ -156,7 +156,7 @@ static void ScanFunc( void * _data )
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, 0);
if ( title )
{
hb_list_add( data->title_set->list_title, title );
@@ -170,7 +170,8 @@ 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,
+ data->min_title_duration);
if ( title != NULL )
{
hb_list_add( data->title_set->list_title, title );