| 3346 | } |
| 3347 | |
| 3348 | gint64 |
| 3349 | ghb_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 | |
| 3377 | gint64 |
| 3378 | ghb_get_chapter_duration(const hb_title_t *title, gint chap) |
no test coverage detected