comparison mplayer.c @ 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
comparison
equal deleted inserted replaced
22143:be16314071fe 22144:7285f260cc27
2964 if (spudec_changed(vo_spudec)) 2964 if (spudec_changed(vo_spudec))
2965 vo_osd_changed(OSDTYPE_SPU); 2965 vo_osd_changed(OSDTYPE_SPU);
2966 } else if (dvdsub_id >= 0 && type == 't') { 2966 } else if (dvdsub_id >= 0 && type == 't') {
2967 static subtitle subs; 2967 static subtitle subs;
2968 double curpts = sh_video->pts + sub_delay; 2968 double curpts = sh_video->pts + sub_delay;
2969 double pts = MP_NOPTS_VALUE;
2970 double endpts; 2969 double endpts;
2971 vo_sub = &subs; 2970 vo_sub = &subs;
2972 while (d_dvdsub->first) { 2971 while (d_dvdsub->first) {
2973 double nextpts = ds_get_next_pts(d_dvdsub); 2972 double pts = ds_get_next_pts(d_dvdsub);
2974 if (nextpts == MP_NOPTS_VALUE || nextpts > curpts) 2973 if (pts > curpts)
2975 break; 2974 break;
2976 endpts = d_dvdsub->first->endpts; 2975 endpts = d_dvdsub->first->endpts;
2977 len = ds_get_packet_sub(d_dvdsub, &packet); 2976 len = ds_get_packet_sub(d_dvdsub, &packet);
2978 pts = nextpts;
2979 }
2980 #ifdef USE_ASS 2977 #ifdef USE_ASS
2981 if (ass_enabled) { 2978 if (ass_enabled) {
2982 static ass_track_t *global_ass_track = NULL; 2979 static ass_track_t *global_ass_track = NULL;
2983 if (!global_ass_track) global_ass_track = ass_default_track(ass_library); 2980 if (!global_ass_track) global_ass_track = ass_default_track(ass_library);
2984 ass_track = global_ass_track; 2981 ass_track = global_ass_track;
2996 if (pts != MP_NOPTS_VALUE) { 2993 if (pts != MP_NOPTS_VALUE) {
2997 if (endpts == MP_NOPTS_VALUE) 2994 if (endpts == MP_NOPTS_VALUE)
2998 sub_clear_text(&subs, MP_NOPTS_VALUE); 2995 sub_clear_text(&subs, MP_NOPTS_VALUE);
2999 sub_add_text(&subs, packet, len, endpts); 2996 sub_add_text(&subs, packet, len, endpts);
3000 vo_osd_changed(OSDTYPE_SUBTITLE); 2997 vo_osd_changed(OSDTYPE_SUBTITLE);
3001 } else if (sub_clear_text(&subs, curpts)) 2998 }
2999 }
3000 if (sub_clear_text(&subs, curpts))
3002 vo_osd_changed(OSDTYPE_SUBTITLE); 3001 vo_osd_changed(OSDTYPE_SUBTITLE);
3003 } 3002 }
3004 current_module=NULL; 3003 current_module=NULL;
3005 } 3004 }
3006 3005