diff --git a/player/command.c b/player/command.c index 65469988d90be..70c4b51825760 100644 --- a/player/command.c +++ b/player/command.c @@ -56,6 +56,7 @@ #include "options/m_config_frontend.h" #include "options/parse_configfile.h" #include "osdep/getpid.h" +#include "video/decode/vd_lavc.h" #include "video/out/gpu/context.h" #include "video/out/vo.h" #include "video/csputils.h" @@ -7388,6 +7389,16 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, mpctx->ipc_ctx = mp_init_ipc(mpctx->clients, mpctx->global); } + if (opt_ptr == &opts->vd_lavc_params->threads) { + struct track *track = mpctx->current_track[0][STREAM_VIDEO]; + uninit_video_chain(mpctx); + reinit_video_chain(mpctx); + if (track) + queue_seek(mpctx, MPSEEK_RELATIVE, 0.0, MPSEEK_EXACT, 0); + + mp_wakeup_core(mpctx); + } + if (opt_ptr == &opts->vo->video_driver_list || opt_ptr == &opts->ra_ctx_opts->context_list || opt_ptr == &opts->ra_ctx_opts->context_type) { diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 05b66edbd8ed5..3f1d2f19b97da 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -56,6 +56,8 @@ #include "options/m_option.h" +#include "vd_lavc.h" + static void init_avctx(struct mp_filter *vd); static void uninit_avctx(struct mp_filter *vd); @@ -69,28 +71,6 @@ static int hwdec_opt_help(struct mp_log *log, const m_option_t *opt, #define OPT_BASE_STRUCT struct vd_lavc_params -struct vd_lavc_params { - bool fast; - int film_grain; - bool show_all; - int skip_loop_filter; - int skip_idct; - int skip_frame; - int framedrop; - int threads; - bool bitexact; - bool old_x264; - bool apply_cropping; - bool check_hw_profile; - int software_fallback; - char **avopts; - int dr; - char **hwdec_api; - char *hwdec_codecs; - int hwdec_image_format; - int hwdec_extra_frames; -}; - static const struct m_opt_choice_alternatives discard_names[] = { {"none", AVDISCARD_NONE}, {"default", AVDISCARD_DEFAULT}, diff --git a/video/decode/vd_lavc.h b/video/decode/vd_lavc.h new file mode 100644 index 0000000000000..cdd39a614da78 --- /dev/null +++ b/video/decode/vd_lavc.h @@ -0,0 +1,28 @@ +#ifndef MPLAYER_VD_LAVC +#define MPLAYER_VD_LAVC + +#include + +struct vd_lavc_params { + bool fast; + int film_grain; + bool show_all; + int skip_loop_filter; + int skip_idct; + int skip_frame; + int framedrop; + int threads; + bool bitexact; + bool old_x264; + bool apply_cropping; + bool check_hw_profile; + int software_fallback; + char **avopts; + int dr; + char **hwdec_api; + char *hwdec_codecs; + int hwdec_image_format; + int hwdec_extra_frames; +}; + +#endif