diff options
author | Jan Ekström <jeebjp@gmail.com> | 2019-09-18 21:26:05 +0300 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2019-09-19 00:02:03 +0300 |
commit | 1b9370ff92a7fdf347d087db7c29bf682abadb9e (patch) | |
tree | 644772429f2d9dfd73b64ffd9f1bfcbd22c37e79 /sub/sd_ass.c | |
parent | 80c4aaa2a4e7ada6530ad4f16172283cd82fcc1d (diff) | |
download | mpv-1b9370ff92a7fdf347d087db7c29bf682abadb9e.tar.bz2 mpv-1b9370ff92a7fdf347d087db7c29bf682abadb9e.tar.xz |
sub/lavc_conv: switch to the newer "ass" subtitle decoding mode
Existing since 2016, this removes timestamps from the lines,
and gives more precision in the timestamps (1:1000).
Diffstat (limited to 'sub/sd_ass.c')
-rw-r--r-- | sub/sd_ass.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sub/sd_ass.c b/sub/sd_ass.c index 1cecfe3215..d3eee38a45 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -241,13 +241,19 @@ static void decode(struct sd *sd, struct demux_packet *packet) } packet->duration = UNKNOWN_DURATION; } - char **r = lavc_conv_decode(ctx->converter, packet); + double sub_pts = 0; + double sub_duration = 0; + char **r = lavc_conv_decode(ctx->converter, packet, &sub_pts, + &sub_duration); + for (int n = 0; r && r[n]; n++) { char *ass_line = r[n]; if (sd->opts->sub_filter_SDH) ass_line = filter_SDH(sd, track->event_format, 0, ass_line, 0); if (ass_line) - ass_process_data(track, ass_line, strlen(ass_line)); + ass_process_chunk(track, ass_line, strlen(ass_line), + llrint(sub_pts * 1000), + llrint(sub_duration * 1000)); if (sd->opts->sub_filter_SDH) talloc_free(ass_line); } |