summaryrefslogtreecommitdiffstats
path: root/player/sub.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-16 23:15:59 +0100
committerwm4 <wm4@nowhere>2015-11-16 23:17:33 +0100
commit85450d06a1b1a08fce277f7f14d5ee33b12f8eab (patch)
treece03648a54db276113bbf5d29ce78a3e4c265460 /player/sub.c
parent70df1608d6f74f3eba9a5e593822984194f63951 (diff)
downloadmpv-85450d06a1b1a08fce277f7f14d5ee33b12f8eab.tar.bz2
mpv-85450d06a1b1a08fce277f7f14d5ee33b12f8eab.tar.xz
player: use demuxer ts offset to simplify timeline ts handling
Use the demux_set_ts_offset() added in the previous commit to base each timeline segment to use timestamps according to its relative position within the overall timeline. As a consequence we don't need to care about these timestamps anymore, and everything becomes simpler. (Another minor but delicious nugget of sanity.)
Diffstat (limited to 'player/sub.c')
-rw-r--r--player/sub.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/player/sub.c b/player/sub.c
index 384339c9e2..e326b3e2fd 100644
--- a/player/sub.c
+++ b/player/sub.c
@@ -195,7 +195,6 @@ void update_osd_sub_state(struct MPContext *mpctx, int order,
struct osd_sub_state *out_state)
{
struct MPOpts *opts = mpctx->opts;
- struct track *track = mpctx->current_track[order][STREAM_SUB];
struct dec_sub *dec_sub = mpctx->d_sub[order];
int obj = order ? OSDTYPE_SUB2 : OSDTYPE_SUB;
bool textsub = dec_sub && sub_has_get_text(dec_sub);
@@ -204,7 +203,6 @@ void update_osd_sub_state(struct MPContext *mpctx, int order,
.dec_sub = dec_sub,
// Decides whether to use OSD path or normal subtitle rendering path.
.render_bitmap_subs = opts->ass_enabled || !textsub,
- .video_offset = get_track_video_offset(mpctx, track),
};
// Secondary subs are rendered with the "text" renderer to transform them
@@ -240,7 +238,7 @@ static void update_subtitle(struct MPContext *mpctx, int order)
struct osd_sub_state state;
update_osd_sub_state(mpctx, order, &state);
- double refpts_s = mpctx->playback_pts - state.video_offset;
+ double refpts_s = mpctx->playback_pts;
double curpts_s = refpts_s - opts->sub_delay;
if (!track->preloaded && track->stream) {