diff options
author | John Stebbins <[email protected]> | 2019-06-27 14:21:44 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2019-06-27 14:21:44 -0700 |
commit | c1fb6e1fcff8740850521d8282d8760279393b1f (patch) | |
tree | 7e8a50167ff89adf1e1e448b31814c928f9d3e3f /gtk/src/hb-backend.c | |
parent | 19ba0208c2ac34ddaffed61af3ffecdc87d77576 (diff) |
LinGui: refactor some code
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r-- | gtk/src/hb-backend.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index c79b821b7..04072d4c2 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -3139,26 +3139,23 @@ init_ui_combo_boxes(GtkBuilder *builder) } } -void -ghb_part_duration(const hb_title_t *title, gint sc, gint ec, gint *hh, gint *mm, gint *ss) +gint64 +ghb_chapter_range_get_duration(const hb_title_t *title, gint sc, gint ec) { hb_chapter_t * chapter; gint count, c; gint64 duration; - *hh = *mm = *ss = 0; - if (title == NULL) return; + if (title == NULL) return 0; - *hh = title->hours; - *mm = title->minutes; - *ss = title->seconds; + duration = title->duration; count = hb_list_count(title->list_chapter); if (sc > count) sc = count; if (ec > count) ec = count; if (sc == 1 && ec == count) - return; + return duration; duration = 0; for (c = sc; c <= ec; c++) @@ -3166,10 +3163,7 @@ ghb_part_duration(const hb_title_t *title, gint sc, gint ec, gint *hh, gint *mm, chapter = hb_list_item(title->list_chapter, c-1); duration += chapter->duration; } - - *hh = duration / 90000 / 3600; - *mm = ((duration / 90000) % 3600) / 60; - *ss = (duration / 90000) % 60; + return duration; } gint64 |