Get title id of feature or longest title
| 2871 | |
| 2872 | // Get title id of feature or longest title |
| 2873 | gint |
| 2874 | ghb_longest_title (void) |
| 2875 | { |
| 2876 | hb_title_set_t * title_set; |
| 2877 | const hb_title_t * title; |
| 2878 | gint count = 0, ii, longest = -1; |
| 2879 | uint64_t duration = 0; |
| 2880 | |
| 2881 | ghb_log_func(); |
| 2882 | if (h_scan == NULL) return 0; |
| 2883 | title_set = hb_get_title_set( h_scan ); |
| 2884 | count = hb_list_count( title_set->list_title ); |
| 2885 | if (count < 1) return -1; |
| 2886 | |
| 2887 | // Check that the feature title in the title_set exists in the list |
| 2888 | // of titles. If not, pick the longest. |
| 2889 | for (ii = 0; ii < count; ii++) |
| 2890 | { |
| 2891 | title = hb_list_item(title_set->list_title, ii); |
| 2892 | if (title->index == title_set->feature) |
| 2893 | return title_set->feature; |
| 2894 | if (title->duration > duration) |
| 2895 | longest = title->index; |
| 2896 | } |
| 2897 | return longest; |
| 2898 | } |
| 2899 | |
| 2900 | const gchar* |
| 2901 | ghb_get_source_audio_lang(const hb_title_t *title, gint track) |
no test coverage detected