summaryrefslogtreecommitdiffstats
path: root/gtk/src/hb-backend.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-06-27 14:21:44 -0700
committerJohn Stebbins <[email protected]>2019-06-27 14:21:44 -0700
commitc1fb6e1fcff8740850521d8282d8760279393b1f (patch)
tree7e8a50167ff89adf1e1e448b31814c928f9d3e3f /gtk/src/hb-backend.c
parent19ba0208c2ac34ddaffed61af3ffecdc87d77576 (diff)
LinGui: refactor some code
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r--gtk/src/hb-backend.c18
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