diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c index 166ee236c0..3e667d2534 100644 --- a/libmpdemux/demux_mkv.c +++ b/libmpdemux/demux_mkv.c @@ -2566,42 +2566,10 @@ demux_mkv_read_block_lacing (uint8_t *buffer, uint64_t *size, return 0; } -static void fix_ass_packet(char **block, int64_t *size, - uint64_t block_duration, uint64_t timecode) -{ - char *line, *layer, *ptr = *block, *end = ptr+*size; - *end = 0; - for (; *ptr!=',' && ptrsubtitle_type == MATROSKA_SUBTYPE_SSA) - fix_ass_packet(&data, &size, block_duration, timecode); - sub_utf8 = 1; dp = new_demux_packet(size); - memcpy(dp->buffer, data, size); + memcpy(dp->buffer, block, size); dp->pts = timecode / 1000.0f; dp->endpts = (timecode + block_duration) / 1000.0f; ds_add_packet(demuxer->sub, dp); - if (data != block) - free(data); } // Taken from demux_real.c. Thanks to the original developpers :) diff --git a/mpcommon.c b/mpcommon.c index 489cc5fc48..79af866cab 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -122,7 +122,9 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) ass_track = sh ? sh->ass_track : NULL; if (!ass_track) continue; if (type == 'a') { // ssa/ass subs with libass - ass_process_data(ass_track, packet, len); + ass_process_chunk(ass_track, packet, len, + (long long)(pts*1000 + 0.5), + (long long)((endpts-pts)*1000 + 0.5)); } else { // plaintext subs with libass vo_sub = NULL; if (pts != MP_NOPTS_VALUE) { @@ -143,7 +145,7 @@ void update_subtitles(sh_video_t *sh_video, demux_stream_t *d_dvdsub, int reset) if (type == 'a') { // ssa/ass subs without libass => convert to plaintext int i; unsigned char* p = packet; - for (i=0; i < 9 && *p != '\0'; p++) + for (i=0; i < 8 && *p != '\0'; p++) if (*p == ',') i++; if (*p == '\0') /* Broken line? */