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.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -117,6 +117,8 @@ enum var_name { · 116 unmodified lines | |||
| 117 | typedef struct LibplaceboInput { | 117 | typedef struct LibplaceboInput { |
| 118 | pl_renderer renderer; | 118 | pl_renderer renderer; |
| 119 | pl_queue queue; | 119 | pl_queue queue; |
| 120 | enum pl_queue_status qstatus; | ||
| 121 | struct pl_frame_mix mix; ///< temporary storage | ||
| 120 | AVFilterLink *link; | 122 | AVFilterLink *link; |
| 121 | AVFifo *out_pts; ///< timestamps of wanted output frames | 123 | AVFifo *out_pts; ///< timestamps of wanted output frames |
| 122 | int64_t status_pts; | 124 | int64_t status_pts; |
| @@ -952,9 +954,6 @@ static int libplacebo_activate(AVFilterContext *ctx) · 829 unmodified lines | |||
| 952 | return ret; | 954 | return ret; |
| 953 | 955 | ||
| 954 | if (ff_outlink_frame_wanted(outlink)) { | 956 | if (ff_outlink_frame_wanted(outlink)) { |
| 955 | struct pl_frame_mix mix; | ||
| 956 | enum pl_queue_status ret; | ||
| 957 | |||
| 958 | if (s->fps.num) { | 957 | if (s->fps.num) { |
| 959 | pts = outlink->frame_count_out; | 958 | pts = outlink->frame_count_out; |
| 960 | } else if (av_fifo_peek(in->out_pts, &pts, 1, 0) < 0) { | 959 | } 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 | |||
| 972 | return 0; | 971 | return 0; |
| 973 | } | 972 | } |
| 974 | 973 | ||
| 975 | ret = pl_queue_update(in->queue, &mix, pl_queue_params( | 974 | in->qstatus = pl_queue_update(in->queue, &in->mix, pl_queue_params( |
| 976 | .pts = pts * av_q2d(outlink->time_base), | 975 | .pts = pts * av_q2d(outlink->time_base), |
| 977 | .radius = pl_frame_mix_radius(&s->params), | 976 | .radius = pl_frame_mix_radius(&s->params), |
| 978 | .vsync_duration = av_q2d(av_inv_q(outlink->frame_rate)), | 977 | .vsync_duration = av_q2d(av_inv_q(outlink->frame_rate)), |
| 979 | )); | 978 | )); |
| 980 | 979 | ||
| 981 | switch (ret) { | 980 | switch (in->qstatus) { |
| 982 | case PL_QUEUE_MORE: | 981 | case PL_QUEUE_MORE: |
| 983 | ff_inlink_request_frame(in->link); | 982 | ff_inlink_request_frame(in->link); |
| 984 | return 0; | 983 | return 0; |
| 985 | case PL_QUEUE_OK: | 984 | case PL_QUEUE_OK: |
| 986 | if (!s->fps.num) | 985 | if (!s->fps.num) |
| 987 | av_fifo_drain2(in->out_pts, 1); | 986 | av_fifo_drain2(in->out_pts, 1); |
| 988 | return output_frame_mix(ctx, &mix, pts); | 987 | return output_frame_mix(ctx, &in->mix, pts); |
| 989 | case PL_QUEUE_ERR: | 988 | case PL_QUEUE_ERR: |
| 990 | return AVERROR_EXTERNAL; | 989 | return AVERROR_EXTERNAL; |
| 991 | } | 990 | } |