added webvtt support

This commit is contained in:
Charles Duco
2019-01-11 17:11:52 +01:00
committed by Thilo Graf
parent 5f71277215
commit 99844a02dd
2 changed files with 9 additions and 2 deletions

View File

@@ -232,6 +232,10 @@ static int Write(Context_t *context, void *data)
{
fprintf(stderr, "{\"s_a\":{\"id\":%d,\"s\":%lld,\"e\":%lld,\"t\":\"%s\"}}\n", out->trackId, out->pts / 90, out->pts / 90 + out->durationMS, ass_get_text((char *)out->data));
}
else if (!strncmp("D_WEBVTT/SUBTITLES", Encoding, 18))
{
fprintf(stderr, "{\"s_a\":{\"id\":%d,\"s\":%lld,\"e\":%lld,\"t\":\"%s\"}}\n", out->trackId, out->pts / 90, out->pts / 90 + out->durationMS, json_string_escape((char *)out->data));
}
else
{
subtitle_err("unknown encoding %s\n", Encoding);