diff options
author | wm4 <wm4@nowhere> | 2020-03-05 11:33:37 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-03-05 22:00:50 +0100 |
commit | c1ff54e2e4ec3e93f20afac99f085fd632cbcc4e (patch) | |
tree | 1727faed4b779e73b39206af9b70a657d3e0795a /filters | |
parent | 23f560daa35681528113444e75ae28a329e16604 (diff) | |
download | mpv-c1ff54e2e4ec3e93f20afac99f085fd632cbcc4e.tar.bz2 mpv-c1ff54e2e4ec3e93f20afac99f085fd632cbcc4e.tar.xz |
f_decoder_wrapper: enable DR and hwdec with --vd-queue-enable
This was forgotten.
Hardware decoding typically breaks immediately, because many hw decoding
APIs require allocating all surfaces in advance (and/or libavcodec was
not made flexible enough to add new surfaces later). If the queue is
large enough, it will run out of surfaces, fail decoding, and fall back
to software decoding. We consider this the user's fault.
--hwdec-extra-frames can be used to avoid this, if you have enough GPU
memory, and the needed number of frames is lower than the arbitrary
mpv-set maximum limit of that option.
Diffstat (limited to 'filters')
-rw-r--r-- | filters/f_decoder_wrapper.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/filters/f_decoder_wrapper.c b/filters/f_decoder_wrapper.c index 9f35c5ec2d..d5ce6725d3 100644 --- a/filters/f_decoder_wrapper.c +++ b/filters/f_decoder_wrapper.c @@ -155,6 +155,7 @@ struct priv { struct m_config_cache *opt_cache; struct dec_wrapper_opts *opts; struct dec_queue_opts *queue_opts; + struct mp_stream_info stream_info; struct mp_codec_params *codec; struct mp_decoder *decoder; @@ -1185,6 +1186,15 @@ struct mp_decoder_wrapper *mp_decoder_wrapper_create(struct mp_filter *parent, p->dec_root_filter = mp_filter_create_root(public_f->global); mp_filter_root_set_wakeup_cb(p->dec_root_filter, wakeup_dec_thread, p); + struct mp_stream_info *sinfo = mp_filter_find_stream_info(parent); + if (sinfo) { + p->dec_root_filter->stream_info = &p->stream_info; + p->stream_info = (struct mp_stream_info){ + .dr_vo = sinfo->dr_vo, + .hwdec_devs = sinfo->hwdec_devs, + }; + } + update_queue_config(p); } |