History

f_decoder_wrapper: allow changing --ad and --vd at runtime

Dudemanguy committed 1 year ago

Commit 0e03fdf1 parent 8d665ac3 files · +18 −1Browse files

Unified · Split

3 files
  1. filters/f_decoder_wrapper.c +2 −0
  2. options/m_option.h +3 −1
  3. player/command.c +13 −0
filters/f_decoder_wrapper.c+2−0
@@ -114,8 +114,10 @@ const struct m_sub_options dec_wrapper_conf = { · 113 unmodified lines
114 {"correct-pts", OPT_BOOL(correct_pts)},114 {"correct-pts", OPT_BOOL(correct_pts)},
115 {"container-fps-override", OPT_DOUBLE(fps_override), M_RANGE(0, DBL_MAX)},115 {"container-fps-override", OPT_DOUBLE(fps_override), M_RANGE(0, DBL_MAX)},
116 {"ad", OPT_STRING(audio_decoders),116 {"ad", OPT_STRING(audio_decoders),
117 .flags = UPDATE_AD,
117 .help = decoder_list_help},118 .help = decoder_list_help},
118 {"vd", OPT_STRING(video_decoders),119 {"vd", OPT_STRING(video_decoders),
120 .flags = UPDATE_VD,
119 .help = decoder_list_help},121 .help = decoder_list_help},
120 {"audio-spdif", OPT_STRING(audio_spdif),122 {"audio-spdif", OPT_STRING(audio_spdif),
121 .help = decoder_list_help},123 .help = decoder_list_help},
options/m_option.h+3−1
@@ -444,7 +444,9 @@ char *format_file_size(int64_t size); · 443 unmodified lines
444#define UPDATE_VO (1 << 16) // reinit the VO444#define UPDATE_VO (1 << 16) // reinit the VO
445#define UPDATE_CLIPBOARD (1 << 17) // reinit the clipboard445#define UPDATE_CLIPBOARD (1 << 17) // reinit the clipboard
446#define UPDATE_DEMUXER (1 << 18) // invalidate --prefetch-playlist's data446#define UPDATE_DEMUXER (1 << 18) // invalidate --prefetch-playlist's data
447#define UPDATE_OPT_LAST (1 << 18)447#define UPDATE_AD (1 << 19) // reinit audio chain and decoder
448#define UPDATE_VD (1 << 20) // reinit video chain and decoder
449#define UPDATE_OPT_LAST (1 << 20)
448 450
449// All bits between of UPDATE_ flags451// All bits between of UPDATE_ flags
450#define UPDATE_OPTS_MASK ((UPDATE_OPT_LAST << 1) - 1)452#define UPDATE_OPTS_MASK ((UPDATE_OPT_LAST << 1) - 1)
player/command.c+13−0
@@ -7747,6 +7747,19 @@ void mp_option_change_callback(void *ctx, struct m_config_option *co, int flags, · 7746 unmodified lines
7747 if (flags & UPDATE_DEMUXER)7747 if (flags & UPDATE_DEMUXER)
7748 mpctx->demuxer_changed = true;7748 mpctx->demuxer_changed = true;
7749 7749
7750 if (flags & UPDATE_AD) {
7751 uninit_audio_chain(mpctx);
7752 reinit_audio_chain(mpctx);
7753 }
7754
7755 if (flags & UPDATE_VD) {
7756 struct track *track = mpctx->current_track[0][STREAM_VIDEO];
7757 uninit_video_chain(mpctx);
7758 reinit_video_chain(mpctx);
7759 if (track)
7760 queue_seek(mpctx, MPSEEK_RELATIVE, 0.0, MPSEEK_EXACT, 0);
7761 }
7762
7750 if (opt_ptr == &opts->vo->android_surface_size) {7763 if (opt_ptr == &opts->vo->android_surface_size) {
7751 if (mpctx->video_out)7764 if (mpctx->video_out)
7752 vo_control(mpctx->video_out, VOCTRL_EXTERNAL_RESIZE, NULL);7765 vo_control(mpctx->video_out, VOCTRL_EXTERNAL_RESIZE, NULL);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t