diff options
author | jstebbins <[email protected]> | 2010-04-20 02:19:16 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-04-20 02:19:16 +0000 |
commit | c550723257a62601b8a9331140b9eecfbdca1b79 (patch) | |
tree | 0bc7faefe6f94a5b513ee978b3fb6e8d11a7f66a /macosx/Controller.m | |
parent | 78aaa0da6e4f331d0c9d97a67a15f5eb1aafb5fe (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 'macosx/Controller.m')
-rw-r--r-- | macosx/Controller.m | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/macosx/Controller.m b/macosx/Controller.m index 71cc5a618..6a8814965 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -1803,9 +1803,7 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It { hb_list_t * list; hb_title_t * title; - int indxpri=0; // Used to search the longuest title (default in combobox) - int longuestpri=0; // Used to search the longuest title (default in combobox) - + int feature_title=0; // Used to store the main feature title list = hb_get_titles( fHandle ); @@ -1879,11 +1877,10 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It @"%@/Desktop/%@.mp4", NSHomeDirectory(),[browsedSourceDisplayName stringByDeletingPathExtension]]]; } - - if (longuestpri < title->hours*60*60 + title->minutes *60 + title->seconds) + /* See if this is the main feature according to libhb */ + if (title->index == title->job->feature) { - longuestpri=title->hours*60*60 + title->minutes *60 + title->seconds; - indxpri=i; + feature_title = i; } [fSrcTitlePopUp addItemWithTitle: [NSString @@ -1899,8 +1896,8 @@ static NSString * ChooseSourceIdentifier = @"Choose Source It } else { - /* if not then select the longest title (dvd) */ - [fSrcTitlePopUp selectItemAtIndex: indxpri]; + /* if not then select the main feature title */ + [fSrcTitlePopUp selectItemAtIndex: feature_title]; } [self titlePopUpChanged:nil]; |