From 026fb91615e5528f1d23f1479b0b5fc4f12d04b7 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 12 Apr 2010 21:04:17 +0000 Subject: Make ASS processing work with both subtitle formats, the MKV one and the "standard" one FFmpeg uses. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31034 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mpcommon.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mpcommon.c b/mpcommon.c index 12a0b25896..1416a2a173 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -202,6 +202,9 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd ass_track = sh ? sh->ass_track : NULL; if (!ass_track) continue; if (type == 'a') { // ssa/ass subs with libass + if (len > 10 && memcmp(packet, "Dialogue: ", 10) == 0) + ass_process_data(ass_track, packet, len); + else ass_process_chunk(ass_track, packet, len, (long long)(subpts*1000 + 0.5), (long long)((endpts-subpts)*1000 + 0.5)); @@ -225,7 +228,10 @@ void update_subtitles(sh_video_t *sh_video, double refpts, demux_stream_t *d_dvd if (type == 'a') { // ssa/ass subs without libass => convert to plaintext int i; unsigned char* p = packet; - for (i=0; i < 8 && *p != '\0'; p++) + int skip_commas = 8; + if (len > 10 && memcmp(packet, "Dialogue: ", 10) == 0) + skip_commas = 9; + for (i=0; i < skip_commas && *p != '\0'; p++) if (*p == ',') i++; if (*p == '\0') /* Broken line? */ -- cgit v1.2.3