summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demux/demux.c10
-rw-r--r--player/sub.c3
2 files changed, 9 insertions, 4 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 9404629ad4..3af0651dae 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -598,7 +598,7 @@ static bool read_packet(struct demux_internal *in)
for (int n = 0; n < in->num_streams; n++) {
struct demux_stream *ds = in->streams[n]->ds;
active |= ds->active;
- read_more |= ds->active && !ds->head;
+ read_more |= (ds->active && !ds->head) || ds->refreshing;
packs += ds->packs;
bytes += ds->bytes;
if (ds->active && ds->last_ts != MP_NOPTS_VALUE && in->min_secs > 0 &&
@@ -632,11 +632,13 @@ static bool read_packet(struct demux_internal *in)
return false;
}
+ double seek_pts = get_refresh_seek_pts(in);
+ bool refresh_seek = seek_pts != MP_NOPTS_VALUE;
+ read_more |= refresh_seek;
+
if (!read_more)
return false;
- double seek_pts = get_refresh_seek_pts(in);
-
// Actually read a packet. Drop the lock while doing so, because waiting
// for disk or network I/O can take time.
in->idle = false;
@@ -645,7 +647,7 @@ static bool read_packet(struct demux_internal *in)
struct demuxer *demux = in->d_thread;
- if (seek_pts != MP_NOPTS_VALUE) {
+ if (refresh_seek) {
MP_VERBOSE(in, "refresh seek to %f\n", seek_pts);
demux->desc->seek(demux, seek_pts, SEEK_BACKWARD | SEEK_HR);
}
diff --git a/player/sub.c b/player/sub.c
index 6d01e0ca5d..c4a24fe011 100644
--- a/player/sub.c
+++ b/player/sub.c
@@ -183,6 +183,9 @@ void reinit_sub(struct MPContext *mpctx, struct track *track)
int order = get_order(mpctx, track);
osd_set_sub(mpctx->osd, order, track->d_sub);
sub_control(track->d_sub, SD_CTRL_SET_TOP, &(bool){!!order});
+
+ if (mpctx->playback_initialized)
+ update_subtitles(mpctx, mpctx->playback_pts);
}
void reinit_sub_all(struct MPContext *mpctx)