mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
command: don't run UPDATE_{AD,VD} if the {ao,vo}_chain doesn't exist
As described in 544240c829, the callbacks
are all run on init so UPDATE_AD and UPDATE_VD both executed. While this
is probably not harmful, it is completely pointless work and results in
extra event notifications being sent. Just skip these if there is no
matching chain.
This commit is contained in:
@@ -7748,12 +7748,12 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags,
|
||||
if (flags & UPDATE_DEMUXER)
|
||||
mpctx->demuxer_changed = true;
|
||||
|
||||
if (flags & UPDATE_AD) {
|
||||
if (flags & UPDATE_AD && mpctx->ao_chain) {
|
||||
uninit_audio_chain(mpctx);
|
||||
reinit_audio_chain(mpctx);
|
||||
}
|
||||
|
||||
if (flags & UPDATE_VD) {
|
||||
if (flags & UPDATE_VD && mpctx->vo_chain) {
|
||||
struct track *track = mpctx->current_track[0][STREAM_VIDEO];
|
||||
uninit_video_chain(mpctx);
|
||||
reinit_video_chain(mpctx);
|
||||
|
||||
Reference in New Issue
Block a user