Mercurial > mplayer.hg
changeset 22144:7285f260cc27
Fix multiple appearing or appearing+disappearing subs in the same frame
in non-ASS mode. The latter is common (old sub replaced by new) and
resulted in an incorrect frame where both appeared simultaneously.
author | uau |
---|---|
date | Tue, 06 Feb 2007 00:18:35 +0000 |
parents | be16314071fe |
children | 48dcbb6d8717 |
files | mplayer.c |
diffstat | 1 files changed, 5 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/mplayer.c Mon Feb 05 23:56:18 2007 +0000 +++ b/mplayer.c Tue Feb 06 00:18:35 2007 +0000 @@ -2966,17 +2966,14 @@ } else if (dvdsub_id >= 0 && type == 't') { static subtitle subs; double curpts = sh_video->pts + sub_delay; - double pts = MP_NOPTS_VALUE; double endpts; vo_sub = &subs; while (d_dvdsub->first) { - double nextpts = ds_get_next_pts(d_dvdsub); - if (nextpts == MP_NOPTS_VALUE || nextpts > curpts) + double pts = ds_get_next_pts(d_dvdsub); + if (pts > curpts) break; endpts = d_dvdsub->first->endpts; len = ds_get_packet_sub(d_dvdsub, &packet); - pts = nextpts; - } #ifdef USE_ASS if (ass_enabled) { static ass_track_t *global_ass_track = NULL; @@ -2998,7 +2995,9 @@ sub_clear_text(&subs, MP_NOPTS_VALUE); sub_add_text(&subs, packet, len, endpts); vo_osd_changed(OSDTYPE_SUBTITLE); - } else if (sub_clear_text(&subs, curpts)) + } + } + if (sub_clear_text(&subs, curpts)) vo_osd_changed(OSDTYPE_SUBTITLE); } current_module=NULL;