diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-04-12 21:04:17 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-04-12 21:04:17 +0000 |
commit | 026fb91615e5528f1d23f1479b0b5fc4f12d04b7 (patch) | |
tree | 875245ae771c776715f62d9a8132375f0a53f17d /mpcommon.c | |
parent | e16f02fe4001f3056b8efd1a099a563569b73f5d (diff) | |
download | mpv-026fb91615e5528f1d23f1479b0b5fc4f12d04b7.tar.bz2 mpv-026fb91615e5528f1d23f1479b0b5fc4f12d04b7.tar.xz |
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
Diffstat (limited to 'mpcommon.c')
-rw-r--r-- | mpcommon.c | 8 |
1 files changed, 7 insertions, 1 deletions
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? */ |