1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-11 17:39:38 +00:00

sd_ass: fix ASS subtitles coming from demux_lavf

libavformat demuxes ASS subtitles as complete ASS event, rather than
Matroska-mangled events without time codes.
This commit is contained in:
wm4 2012-11-16 22:54:22 +01:00
parent 4e8e7d91dd
commit af8ded53db

View File

@ -77,9 +77,13 @@ static void decode(struct sh_sub *sh, struct osd_state *osd, void *data,
ASS_Track *track = ctx->ass_track;
if (sh->type == 'a') { // ssa/ass subs
ass_process_chunk(track, data, data_len,
(long long)(pts*1000 + 0.5),
(long long)(duration*1000 + 0.5));
if (bstr_startswith0((bstr){data, data_len}, "Dialogue: ")) {
ass_process_data(track, data, data_len);
} else {
ass_process_chunk(track, data, data_len,
(long long)(pts*1000 + 0.5),
(long long)(duration*1000 + 0.5));
}
return;
}
// plaintext subs