diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2024-01-21 18:41:44 +0100 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2024-01-22 15:23:24 +0000 |
commit | 62a0292dc1eec305cfdda2b5dbfe2aff5640dfd4 (patch) | |
tree | ec2736152317ab6ade565a44d0d22c2cfc4c2a81 | |
parent | d00a00e180afb70bec4a1145fb0c0815a892e08d (diff) | |
download | mpv-62a0292dc1eec305cfdda2b5dbfe2aff5640dfd4.tar.bz2 mpv-62a0292dc1eec305cfdda2b5dbfe2aff5640dfd4.tar.xz |
player/video: force vo reconfigure on color parameters change
This workarounds the issue with vo_gpu that would freeze in certain
condition. I haven't go deep inside to understand why, so this should be
considered as a workaround.
Fixes: #13256
-rw-r--r-- | player/video.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/player/video.c b/player/video.c index 20b6df68f6..8599bbe702 100644 --- a/player/video.c +++ b/player/video.c @@ -1041,17 +1041,12 @@ static void apply_video_crop(struct MPContext *mpctx, struct vo *vo) } } -static bool video_reconfig_needed(const struct mp_image_params *p1, - const struct mp_image_params *p2) +static bool video_reconfig_needed(struct mp_image_params a, + struct mp_image_params b) { - return p1->imgfmt != p2->imgfmt || - p1->hw_subfmt != p2->hw_subfmt || - p1->w != p2->w || p1->h != p2->h || - p1->p_w != p2->p_w || p1->p_h != p2->p_h || - p1->force_window != p2->force_window || - p1->rotate != p2->rotate || - p1->stereo3d != p2->stereo3d || - !mp_rect_equals(&p1->crop, &p2->crop); + a.color.hdr = (struct pl_hdr_metadata){0}; + b.color.hdr = (struct pl_hdr_metadata){0}; + return !mp_image_params_equal(&a, &b); } void write_video(struct MPContext *mpctx) @@ -1176,7 +1171,7 @@ void write_video(struct MPContext *mpctx) // Filter output is different from VO input? struct mp_image_params *p = &mpctx->next_frames[0]->params; - if (!vo->params || video_reconfig_needed(p, vo->params)) { + if (!vo->params || video_reconfig_needed(*p, *vo->params)) { // Changing config deletes the current frame; wait until it's finished. if (vo_still_displaying(vo)) return; |