diff --git a/player/loadfile.c b/player/loadfile.c index 18a225568e..f3861e25eb 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -64,8 +64,6 @@ static void reselect_demux_streams(struct MPContext *mpctx); static void uninit_sub(struct MPContext *mpctx, int order) { - if (mpctx->d_sub[order]) - sub_reset(mpctx->d_sub[order]); mpctx->d_sub[order] = NULL; // Note: not free'd. int obj = order ? OSDTYPE_SUB2 : OSDTYPE_SUB; osd_set_sub(mpctx->osd, obj, NULL); diff --git a/player/sub.c b/player/sub.c index d6903c146e..efd2f68464 100644 --- a/player/sub.c +++ b/player/sub.c @@ -237,7 +237,5 @@ void reinit_subs(struct MPContext *mpctx, int order) if (order == 1 && sub_has_get_text(dec_sub)) state.render_bitmap_subs = false; - reset_subtitles(mpctx, order); - osd_set_sub(mpctx->osd, obj, &state); } diff --git a/sub/sd_lavc.c b/sub/sd_lavc.c index f47bd94f19..72a6915287 100644 --- a/sub/sd_lavc.c +++ b/sub/sd_lavc.c @@ -51,7 +51,6 @@ struct sd_lavc_priv { struct sub_bitmap *outbitmaps; int64_t displayed_id; int64_t new_id; - bool unknown_pts; // at least one sub with MP_NOPTS_VALUE start struct mp_image_params video_params; }; @@ -199,10 +198,8 @@ static void decode(struct sd *sd, struct demux_packet *packet) if (duration == 0) duration = -1; - if (pts == MP_NOPTS_VALUE) { + if (pts == MP_NOPTS_VALUE) MP_WARN(sd, "Subtitle with unknown start time.\n"); - priv->unknown_pts = true; - } av_init_packet(&pkt); pkt.data = packet->buffer; @@ -317,11 +314,8 @@ static void reset(struct sd *sd) { struct sd_lavc_priv *priv = sd->priv; - if (priv->unknown_pts) { - for (int n = 0; n < MAX_QUEUE; n++) - clear_sub(&priv->subs[n]); - priv->unknown_pts = false; - } + for (int n = 0; n < MAX_QUEUE; n++) + clear_sub(&priv->subs[n]); // lavc might not do this right for all codecs; may need close+reopen avcodec_flush_buffers(priv->avctx); }