From a407645214693cbaf45d6c333715968b31838214 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Fri, 5 Nov 2010 21:56:32 +0000 Subject: [PATCH] log the title duration before throwing it out when it's too short git-svn-id: svn://localhost/HandBrake/trunk@3649 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/bd.c | 14 +++++++------- libhb/dvdnav.c | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libhb/bd.c b/libhb/bd.c index ca09ce73..4e682af0 100644 --- a/libhb/bd.c +++ b/libhb/bd.c @@ -133,13 +133,6 @@ hb_title_t * hb_bd_title_scan( hb_bd_t * d, int tt, uint64_t min_duration ) title->angle_count = ti->angle_count; - /* ignore short titles because they're often stills */ - if( ti->duration < min_duration ) - { - hb_log( "bd: ignoring title (too short)" ); - goto fail; - } - /* Get duration */ title->duration = ti->duration; title->hours = title->duration / 90000 / 3600; @@ -149,6 +142,13 @@ hb_title_t * hb_bd_title_scan( hb_bd_t * d, int tt, uint64_t min_duration ) title->hours, title->minutes, title->seconds, title->duration / 90 ); + /* ignore short titles because they're often stills */ + if( ti->duration < min_duration ) + { + hb_log( "bd: ignoring title (too short)" ); + goto fail; + } + BLURAY_STREAM_INFO * bdvideo = &ti->clips[0].video_streams[0]; title->video_id = bdvideo->pid; diff --git a/libhb/dvdnav.c b/libhb/dvdnav.c index 5f30dedf..9fb7ff97 100644 --- a/libhb/dvdnav.c +++ b/libhb/dvdnav.c @@ -415,6 +415,15 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura } } + /* Get duration */ + title->duration = longest; + title->hours = title->duration / 90000 / 3600; + title->minutes = ( ( title->duration / 90000 ) % 3600 ) / 60; + title->seconds = ( title->duration / 90000 ) % 60; + hb_log( "scan: duration is %02d:%02d:%02d (%"PRId64" ms)", + title->hours, title->minutes, title->seconds, + title->duration / 90 ); + /* ignore titles under 10 seconds because they're often stills or * clips with no audio & our preview code doesn't currently handle * either of these. */ @@ -461,15 +470,6 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura title->cell_end, title->block_start, title->block_end, title->block_count ); - /* Get duration */ - title->duration = longest; - title->hours = title->duration / 90000 / 3600; - title->minutes = ( ( title->duration / 90000 ) % 3600 ) / 60; - title->seconds = ( title->duration / 90000 ) % 60; - hb_log( "scan: duration is %02d:%02d:%02d (%"PRId64" ms)", - title->hours, title->minutes, title->seconds, - title->duration / 90 ); - /* Detect languages */ for( i = 0; i < ifo->vtsi_mat->nr_of_vts_audio_streams; i++ ) { -- 2.11.0