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

Function ghb_chapter_range_get_duration

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

Source from the content-addressed store, hash-verified

3346}
3347
3348gint64
3349ghb_chapter_range_get_duration(const hb_title_t *title, gint sc, gint ec)
3350{
3351 hb_chapter_t * chapter;
3352 gint count, c;
3353 gint64 duration;
3354
3355 if (title == NULL) return 0;
3356
3357 duration = title->duration;
3358
3359 count = hb_list_count(title->list_chapter);
3360 if (sc < 1) sc = 1;
3361 if (ec < 1) ec = 1;
3362 if (sc > count) sc = count;
3363 if (ec > count) ec = count;
3364
3365 if (sc == 1 && ec == count)
3366 return duration;
3367
3368 duration = 0;
3369 for (c = sc; c <= ec; c++)
3370 {
3371 chapter = hb_list_item(title->list_chapter, c-1);
3372 duration += chapter->duration;
3373 }
3374 return duration;
3375}
3376
3377gint64
3378ghb_get_chapter_duration(const hb_title_t *title, gint chap)

Callers 1

title_range_get_durationFunction · 0.85

Calls 2

hb_list_countFunction · 0.85
hb_list_itemFunction · 0.85

Tested by

no test coverage detected