MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / ghb_longest_title

Function ghb_longest_title

gtk/src/hb-backend.c:2873–2898  ·  view source on GitHub ↗

Get title id of feature or longest title

Source from the content-addressed store, hash-verified

2871
2872// Get title id of feature or longest title
2873gint
2874ghb_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
2900const gchar*
2901ghb_get_source_audio_lang(const hb_title_t *title, gint track)

Callers 1

ghb_backend_eventsFunction · 0.85

Calls 3

hb_get_title_setFunction · 0.85
hb_list_countFunction · 0.85
hb_list_itemFunction · 0.85

Tested by

no test coverage detected