summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-04-20 02:19:16 +0000
committerjstebbins <[email protected]>2010-04-20 02:19:16 +0000
commitc550723257a62601b8a9331140b9eecfbdca1b79 (patch)
tree0bc7faefe6f94a5b513ee978b3fb6e8d11a7f66a /gtk/src
parent78aaa0da6e4f331d0c9d97a67a15f5eb1aafb5fe (diff)
add dvd main feature title detection
scans the dvd menus and presses buttons to see where they might lead. when a button press leads to a title, i check to see if it is the longest seen thus far and save it's index. this only applies when dvdnav is enabled. when dvdread is in use, the longest title of all the titles is flagged as the "main feature" git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3245 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/hb-backend.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index abe02b8e7..55f9747c9 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -2019,19 +2019,22 @@ ghb_longest_title()
gint count = 0;
guint64 longest = 0;
gint titleindex = 0;
+ gint feature;
g_debug("ghb_longest_title ()\n");
if (h_scan == NULL) return 0;
list = hb_get_titles( h_scan );
count = hb_list_count( list );
if (count > 100) count = 100;
+ if (count < 1) return 0;
+ title = (hb_title_t*)hb_list_item(list, 0);
+ feature = title->job->feature;
for (ii = 0; ii < count; ii++)
{
title = (hb_title_t*)hb_list_item(list, ii);
- if (title->duration > longest)
+ if (title->index == feature)
{
- titleindex = ii;
- longest = title->duration;
+ return ii;
}
}
return titleindex;