History

lavfi/qsvvpp: Copy frame props before modify it

The changes to output frame props in query_frame overlapped since 578ac59887. Move the copy frame props before the changes.

Fei Wang committed 1 year ago

Commit bc991ca1 parent 351fd841 file · +12 −11Browse files

Unified · Split

libavfilter/qsvvpp.c+12−11
@@ -471,7 +471,8 @@ static QSVFrame *submit_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *p · 470 unmodified lines
471471 }
472472
473473 /* get the output surface */
474−static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink, const AVFrame *in)
474+static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink, const AVFrame *in,
475+ const AVFrame *propref)
475476 {
476477 FilterLink *l = ff_filter_link(outlink);
477478 AVFilterContext *ctx = outlink->src;
@@ -513,6 +514,15 @@ static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink, const AVFr · 35 unmodified lines
513514 return NULL;
514515 }
515516
517+ if (propref) {
518+ ret = av_frame_copy_props(out_frame->frame, propref);
519+ if (ret < 0) {
520+ av_frame_free(&out_frame->frame);
521+ av_log(ctx, AV_LOG_ERROR, "Failed to copy metadata fields from src to dst.\n");
522+ return NULL;
523+ }
524+ }
525+
516526 if (l->frame_rate.num && l->frame_rate.den)
517527 out_frame->frame->duration = av_rescale_q(1, av_inv_q(l->frame_rate), outlink->time_base);
518528 else
@@ -985,7 +995,7 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr · 466 unmodified lines
985995 }
986996
987997 do {
988− out_frame = query_frame(s, outlink, in_frame->frame);
998+ out_frame = query_frame(s, outlink, in_frame->frame, propref);
989999 if (!out_frame) {
9901000 av_log(ctx, AV_LOG_ERROR, "Failed to query an output frame.\n");
9911001 return AVERROR(ENOMEM);
@@ -1009,15 +1019,6 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr · 17 unmodified lines
10091019 break;
10101020 }
10111021
1012− if (propref) {
1013− ret1 = av_frame_copy_props(out_frame->frame, propref);
1014− if (ret1 < 0) {
1015− av_frame_free(&out_frame->frame);
1016− av_log(ctx, AV_LOG_ERROR, "Failed to copy metadata fields from src to dst.\n");
1017− return ret1;
1018− }
1019− }
1020−
10211022 out_frame->frame->pts = av_rescale_q(out_frame->surface.Data.TimeStamp,
10221023 default_tb, outlink->time_base);
10231024

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