History

vo_gpu_next: keep target params in priv instead of alocating it

Kacper Michajłow committed 2 years ago

Commit 89cc4771 parent f167d181 file · +7 −4Browse files

Unified · Split

video/out/vo_gpu_next.c+7−4
@@ -158,6 +158,8 @@ struct priv { · 157 unmodified lines
158158 // Performance data of last frame
159159 struct frame_info perf_fresh;
160160 struct frame_info perf_redraw;
161+
162+ struct mp_image_params target_params;
161163 };
162164
163165 static void update_render_options(struct vo *vo);
@@ -1129,9 +1131,7 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame) · 965 unmodified lines
11291131 pl_frames_infer_mix(p->rr, &mix, &target, &ref_frame);
11301132
11311133 mp_mutex_lock(&vo->params_mutex);
1132− if (!vo->target_params)
1133− vo->target_params = talloc(vo, struct mp_image_params);
1134− *vo->target_params = (struct mp_image_params){
1134+ p->target_params = (struct mp_image_params){
11351135 .imgfmt_name = swframe.fbo->params.format
11361136 ? swframe.fbo->params.format->name : NULL,
11371137 .w = swframe.fbo->params.w,
@@ -1140,6 +1140,7 @@ static void draw_frame(struct vo *vo, struct vo_frame *frame) · 2 unmodified lines
11401140 .repr = target.repr,
11411141 .rotate = target.rotation,
11421142 };
1143+ vo->target_params = &p->target_params;
11431144
11441145 if (vo->params) {
11451146 vo->params->color.hdr = ref_frame.color.hdr;
@@ -1231,7 +1232,9 @@ static int reconfig(struct vo *vo, struct mp_image_params *params) · 85 unmodified lines
12311232 return -1;
12321233
12331234 resize(vo);
1234− TA_FREEP(&vo->target_params);
1235+ mp_mutex_lock(&vo->params_mutex);
1236+ vo->target_params = NULL;
1237+ mp_mutex_unlock(&vo->params_mutex);
12351238 return 0;
12361239 }
12371240

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