mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 01:52:19 +00:00
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.
This commit is contained in:
parent
23f560daa3
commit
c1ff54e2e4
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user