mirror of https://github.com/mpv-player/mpv
video: add `mp_force_video_reinit`
Needed for the next commit
This commit is contained in:
parent
2cc3bc12db
commit
cd0031212a
|
@ -7099,14 +7099,7 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags,
|
|||
if (opt_ptr == &opts->vo->video_driver_list ||
|
||||
opt_ptr == &opts->ra_ctx_opts->context_name ||
|
||||
opt_ptr == &opts->ra_ctx_opts->context_type) {
|
||||
struct track *track = mpctx->current_track[0][STREAM_VIDEO];
|
||||
uninit_video_out(mpctx);
|
||||
handle_force_window(mpctx, true);
|
||||
reinit_video_chain(mpctx);
|
||||
if (track)
|
||||
queue_seek(mpctx, MPSEEK_RELATIVE, 0.0, MPSEEK_EXACT, 0);
|
||||
|
||||
mp_wakeup_core(mpctx);
|
||||
mp_force_video_reinit(mpctx);
|
||||
}
|
||||
|
||||
if (flags & UPDATE_AUDIO)
|
||||
|
|
|
@ -641,6 +641,7 @@ void reinit_video_chain(struct MPContext *mpctx);
|
|||
void reinit_video_chain_src(struct MPContext *mpctx, struct track *track);
|
||||
int reinit_video_filters(struct MPContext *mpctx);
|
||||
void write_video(struct MPContext *mpctx);
|
||||
void mp_force_video_reinit(struct MPContext *mpctx);
|
||||
void mp_force_video_refresh(struct MPContext *mpctx);
|
||||
void uninit_video_out(struct MPContext *mpctx);
|
||||
void uninit_video_chain(struct MPContext *mpctx);
|
||||
|
|
|
@ -293,6 +293,18 @@ err_out:
|
|||
handle_force_window(mpctx, true);
|
||||
}
|
||||
|
||||
void mp_force_video_reinit(struct MPContext *mpctx)
|
||||
{
|
||||
struct track *track = mpctx->current_track[0][STREAM_VIDEO];
|
||||
uninit_video_out(mpctx);
|
||||
handle_force_window(mpctx, true);
|
||||
reinit_video_chain(mpctx);
|
||||
if (track)
|
||||
queue_seek(mpctx, MPSEEK_RELATIVE, 0.0, MPSEEK_EXACT, 0);
|
||||
|
||||
mp_wakeup_core(mpctx);
|
||||
}
|
||||
|
||||
// Try to refresh the video by doing a precise seek to the currently displayed
|
||||
// frame. This can go wrong in all sorts of ways, so use sparingly.
|
||||
void mp_force_video_refresh(struct MPContext *mpctx)
|
||||
|
|
Loading…
Reference in New Issue