* @param h Handle to hb_handle_t
* @param path location of VIDEO_TS folder.
* @param title_index Desired title to scan. 0 for all titles.
+ * @param preview_count Number of preview images to generate.
+ * @param store_previews Whether or not to write previews to disk.
*/
-void hb_scan( hb_handle_t * h, const char * path, int title_index )
+void hb_scan( hb_handle_t * h, const char * path, int title_index,
+ int preview_count, int store_previews )
{
hb_title_t * title;
}
hb_log( "hb_scan: path=%s, title_index=%d", path, title_index );
- h->scan_thread = hb_scan_init( h, path, title_index, h->list_title );
+ h->scan_thread = hb_scan_init( h, path, title_index, h->list_title,
+ preview_count, store_previews );
}
/**
if ( job->maxWidth && (job->maxWidth < job->width) )
width = job->maxWidth;
- height = (double)width / storage_aspect;
+ height = ((double)width / storage_aspect) + 0.5;
if ( job->maxHeight && (job->maxHeight < height) )
height = job->maxHeight;
hb_list_add( title_copy->list_chapter, chapter_copy );
}
+ /*
+ * Copy the metadata
+ */
+ if( title->metadata )
+ {
+ title_copy->metadata = malloc( sizeof( hb_metadata_t ) );
+
+ if( title_copy->metadata )
+ {
+ memcpy( title_copy->metadata, title->metadata, sizeof( hb_metadata_t ) );
+
+ /*
+ * Need to copy the artwork seperatly (TODO).
+ */
+ if( title->metadata->coverart )
+ {
+ title_copy->metadata->coverart = malloc( title->metadata->coverart_size );
+ if( title_copy->metadata->coverart )
+ {
+ memcpy( title_copy->metadata->coverart, title->metadata->coverart,
+ title->metadata->coverart_size );
+ } else {
+ title_copy->metadata->coverart_size = 0;
+ }
+ }
+ }
+ }
+
/* Copy the audio track(s) we want */
title_copy->list_audio = hb_list_init();