From cb32ad68f31de784a13ca5a2847143c4c37738ce Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 21 Sep 2019 20:11:18 +0200 Subject: command: add sub-start & sub-end properties These properties contain the current subtitle's start and end times. Can be useful to cut sample audio through the scripting interface. --- sub/dec_sub.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sub/dec_sub.h') diff --git a/sub/dec_sub.h b/sub/dec_sub.h index 06d4a6127e..5449b97ad0 100644 --- a/sub/dec_sub.h +++ b/sub/dec_sub.h @@ -21,6 +21,11 @@ enum sd_ctrl { SD_CTRL_SET_VIDEO_DEF_FPS, }; +struct sd_times { + double start; + double end; +}; + struct attachment_list { struct demux_attachment *entries; int num_entries; @@ -38,6 +43,7 @@ bool sub_read_packets(struct dec_sub *sub, double video_pts); void sub_get_bitmaps(struct dec_sub *sub, struct mp_osd_res dim, int format, double pts, struct sub_bitmaps *res); char *sub_get_text(struct dec_sub *sub, double pts); +struct sd_times sub_get_times(struct dec_sub *sub, double pts); void sub_reset(struct dec_sub *sub); void sub_select(struct dec_sub *sub, bool selected); void sub_update_opts(struct dec_sub *sub); -- cgit v1.2.3