summaryrefslogtreecommitdiffstats
path: root/player/video.c
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2023-08-25 19:06:00 +0200
committerDudemanguy <random342@airmail.cc>2023-08-31 17:37:42 +0000
commitf3211db7911c89883dc392ddeef8ffe53aeb49b0 (patch)
tree605f723f3115ee37b10f7ad68a80a063876393ed /player/video.c
parent21048291bed43bbd790424ac458f2b09b618a85f (diff)
downloadmpv-f3211db7911c89883dc392ddeef8ffe53aeb49b0.tar.bz2
mpv-f3211db7911c89883dc392ddeef8ffe53aeb49b0.tar.xz
player/video: don't copy mp_image_params when not needed
Diffstat (limited to 'player/video.c')
-rw-r--r--player/video.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/player/video.c b/player/video.c
index 83dbb72b9c..a8556ba700 100644
--- a/player/video.c
+++ b/player/video.c
@@ -1128,8 +1128,8 @@ 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 || !mp_image_params_equal(&p, vo->params)) {
+ struct mp_image_params *p = &mpctx->next_frames[0]->params;
+ if (!vo->params || !mp_image_params_equal(p, vo->params)) {
// Changing config deletes the current frame; wait until it's finished.
if (vo_still_displaying(vo)) {
vo_request_wakeup_on_done(vo);
@@ -1138,16 +1138,16 @@ void write_video(struct MPContext *mpctx)
const struct vo_driver *info = mpctx->video_out->driver;
char extra[20] = {0};
- if (p.p_w != p.p_h) {
+ if (p->p_w != p->p_h) {
int d_w, d_h;
- mp_image_params_get_dsize(&p, &d_w, &d_h);
+ mp_image_params_get_dsize(p, &d_w, &d_h);
snprintf(extra, sizeof(extra), " => %dx%d", d_w, d_h);
}
char sfmt[20] = {0};
- if (p.hw_subfmt)
- snprintf(sfmt, sizeof(sfmt), "[%s]", mp_imgfmt_to_name(p.hw_subfmt));
+ if (p->hw_subfmt)
+ snprintf(sfmt, sizeof(sfmt), "[%s]", mp_imgfmt_to_name(p->hw_subfmt));
MP_INFO(mpctx, "VO: [%s] %dx%d%s %s%s\n",
- info->name, p.w, p.h, extra, mp_imgfmt_to_name(p.imgfmt), sfmt);
+ info->name, p->w, p->h, extra, mp_imgfmt_to_name(p->imgfmt), sfmt);
MP_VERBOSE(mpctx, "VO: Description: %s\n", info->description);
int vo_r = vo_reconfig2(vo, mpctx->next_frames[0]);