summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-07-06 16:21:57 +0000
committerjstebbins <[email protected]>2011-07-06 16:21:57 +0000
commit2633a89fc5f0e52974041d3cf891f304bc0a7315 (patch)
treec7d724e1e0707ad473b204f272b77a429df65c64 /libhb
parentafa69dcabb84b190537d186be8e552ad7ad79ef2 (diff)
libhb: add some logging to main feature search
This lets us see in the logs if it finds a root menu title, a title menu title, or falls back to using the longest title. Log level 2 must be enabled to see these. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4084 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/dvdnav.c44
1 files changed, 33 insertions, 11 deletions
diff --git a/libhb/dvdnav.c b/libhb/dvdnav.c
index eda1988bc..9ccaffc8f 100644
--- a/libhb/dvdnav.c
+++ b/libhb/dvdnav.c
@@ -1252,16 +1252,24 @@ static int hb_dvdnav_main_feature( hb_dvd_t * e, hb_list_t * list_title )
uint64_t longest_duration_root = 0;
uint64_t longest_duration_title = 0;
uint64_t longest_duration_fallback = 0;
+ hb_title_t * title;
+ int index;
+ hb_deep_log( 2, "dvdnav: Searching menus for main feature" );
for ( ii = 0; ii < hb_list_count( list_title ); ii++ )
{
- hb_title_t * title = hb_list_item( list_title, ii );
+ title = hb_list_item( list_title, ii );
if ( title->duration > longest_duration_fallback )
{
longest_duration_fallback = title->duration;
longest_fallback = title->index;
}
}
+ index = find_title( list_title, longest_fallback );
+ title = hb_list_item( list_title, index );
+ hb_deep_log( 2, "dvdnav: Longest title %d duration %02d:%02d:%02d",
+ longest_fallback, title->hours, title->minutes,
+ title->seconds );
dvdnav_reset( d->dvdnav );
skip_some( d->dvdnav, 500 );
@@ -1269,12 +1277,18 @@ static int hb_dvdnav_main_feature( hb_dvd_t * e, hb_list_t * list_title )
longest_root = try_menu( d, list_title, DVD_MENU_Root, longest_duration_fallback );
if ( longest_root >= 0 )
{
- hb_title_t * hbtitle;
- int index;
index = find_title( list_title, longest_root );
- hbtitle = hb_list_item( list_title, index );
- if ( hbtitle )
- longest_duration_root = hbtitle->duration;
+ title = hb_list_item( list_title, index );
+ if ( title )
+ {
+ longest_duration_root = title->duration;
+ hb_deep_log( 2, "dvdnav: Found root title %d duration %02d:%02d:%02d",
+ longest_root, title->hours, title->minutes, title->seconds );
+ }
+ }
+ else
+ {
+ hb_deep_log( 2, "dvdnav: No root menu title found" );
}
if ( longest_root < 0 ||
(float)longest_duration_fallback * 0.7 > longest_duration_root)
@@ -1282,12 +1296,19 @@ static int hb_dvdnav_main_feature( hb_dvd_t * e, hb_list_t * list_title )
longest_title = try_menu( d, list_title, DVD_MENU_Title, longest_duration_fallback );
if ( longest_title >= 0 )
{
- hb_title_t * hbtitle;
- int index;
index = find_title( list_title, longest_title );
- hbtitle = hb_list_item( list_title, index );
- if ( hbtitle )
- longest_duration_title = hbtitle->duration;
+ title = hb_list_item( list_title, index );
+ if ( title )
+ {
+ longest_duration_title = title->duration;
+ hb_deep_log( 2, "dvdnav: found title %d duration %02d:%02d:%02d",
+ longest_title, title->hours, title->minutes,
+ title->seconds );
+ }
+ }
+ else
+ {
+ hb_deep_log( 2, "dvdnav: No title menu title found" );
}
}
@@ -1308,6 +1329,7 @@ static int hb_dvdnav_main_feature( hb_dvd_t * e, hb_list_t * list_title )
{
longest = longest_fallback;
}
+ hb_deep_log( 2, "dvdnav: Main feature search using title %d", longest );
return longest;
}