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 committed 2012-11-16 22:54:22 +01:00
1 parent 4e8e7d91dd
commit af8ded53db
1 file changed
+7 -3
+7 -3
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