History

lavfi/vf_libplacebo: move temporary vars into per-input struct

Including the queue status, because these will need to be re-queried inside output_frame_mix when that function is refactored to handle multiple inputs.

Niklas Haas committed 3 years ago

Commit ad445a71 parent a4197191 file · +5 −6Browse files

Unified · Split

libavfilter/vf_libplacebo.c+5−6
@@ -117,6 +117,8 @@ enum var_name { · 116 unmodified lines
117117 typedef struct LibplaceboInput {
118118 pl_renderer renderer;
119119 pl_queue queue;
120+ enum pl_queue_status qstatus;
121+ struct pl_frame_mix mix; ///< temporary storage
120122 AVFilterLink *link;
121123 AVFifo *out_pts; ///< timestamps of wanted output frames
122124 int64_t status_pts;
@@ -952,9 +954,6 @@ static int libplacebo_activate(AVFilterContext *ctx) · 829 unmodified lines
952954 return ret;
953955
954956 if (ff_outlink_frame_wanted(outlink)) {
955− struct pl_frame_mix mix;
956− enum pl_queue_status ret;
957−
958957 if (s->fps.num) {
959958 pts = outlink->frame_count_out;
960959 } else if (av_fifo_peek(in->out_pts, &pts, 1, 0) < 0) {
@@ -972,20 +971,20 @@ static int libplacebo_activate(AVFilterContext *ctx) · 11 unmodified lines
972971 return 0;
973972 }
974973
975− ret = pl_queue_update(in->queue, &mix, pl_queue_params(
974+ in->qstatus = pl_queue_update(in->queue, &in->mix, pl_queue_params(
976975 .pts = pts * av_q2d(outlink->time_base),
977976 .radius = pl_frame_mix_radius(&s->params),
978977 .vsync_duration = av_q2d(av_inv_q(outlink->frame_rate)),
979978 ));
980979
981− switch (ret) {
980+ switch (in->qstatus) {
982981 case PL_QUEUE_MORE:
983982 ff_inlink_request_frame(in->link);
984983 return 0;
985984 case PL_QUEUE_OK:
986985 if (!s->fps.num)
987986 av_fifo_drain2(in->out_pts, 1);
988− return output_frame_mix(ctx, &mix, pts);
987+ return output_frame_mix(ctx, &in->mix, pts);
989988 case PL_QUEUE_ERR:
990989 return AVERROR_EXTERNAL;
991990 }

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