diff options
author | wm4 <wm4@nowhere> | 2013-07-10 02:09:10 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-10 02:09:10 +0200 |
commit | 07c5327fa0c3411bcb8caad17d70b014d6b022dd (patch) | |
tree | d0cd355f8f617fec732c0d169ead4405949c0ab6 /core | |
parent | 5ec611e7bab8afda8e0242d1754df9b552c368ad (diff) | |
download | mpv-07c5327fa0c3411bcb8caad17d70b014d6b022dd.tar.bz2 mpv-07c5327fa0c3411bcb8caad17d70b014d6b022dd.tar.xz |
core: remove demux_mpg subtitle PTS hack
This code used to be part of the demux_mpg and vobsub specific code
path. Then (just recently) the different code paths for subtitles were
merged, so this code became active even for demux_lavf and demux_mkv.
As far as I can tell, this code won't help much, and at least sd_lavc
(which will be used for DVD subs and other potentially weird things) can
deal with NOPTS values.
Diffstat (limited to 'core')
-rw-r--r-- | core/mplayer.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/core/mplayer.c b/core/mplayer.c index 8470a29295..217e99ed5c 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -1792,20 +1792,6 @@ static void update_subtitles(struct MPContext *mpctx, double refpts_tl) if (!d_sub->first) break; double subpts_s = ds_get_next_pts(d_sub); - if (subpts_s == MP_NOPTS_VALUE) { - // Try old method of getting PTS. This is only needed in the - // DVD playback case with demux_mpg. - // XXX This is wrong, sh_video->pts can be arbitrarily - // much behind demuxing position. Unfortunately using - // d_video->pts which would have been the simplest - // improvement doesn't work because mpeg specific hacks - // in video.c set d_video->pts to 0. - float x = d_sub->pts - refpts_s; - if (x > -20 && x < 20) // prevent missing subs on pts reset - subpts_s = d_sub->pts; - else - subpts_s = curpts_s; - } if (subpts_s > curpts_s) { mp_dbg(MSGT_CPLAYER, MSGL_DBG2, "Sub early: c_pts=%5.3f s_pts=%5.3f\n", @@ -1817,16 +1803,11 @@ static void update_subtitles(struct MPContext *mpctx, double refpts_tl) if (non_interleaved && subpts_s > curpts_s + 1) break; } - struct demux_packet pkt; - struct demux_packet *orig = ds_get_packet_sub(d_sub); - if (!orig) - break; - pkt = *orig; - pkt.pts = subpts_s; + struct demux_packet *pkt = ds_get_packet_sub(d_sub); mp_dbg(MSGT_CPLAYER, MSGL_V, "Sub: c_pts=%5.3f s_pts=%5.3f " - "duration=%5.3f len=%d\n", curpts_s, pkt.pts, pkt.duration, - pkt.len); - sub_decode(dec_sub, &pkt); + "duration=%5.3f len=%d\n", curpts_s, pkt->pts, pkt->duration, + pkt->len); + sub_decode(dec_sub, pkt); } } |