The changes to output frame props in query_frame overlapped since 578ac59887. Move the copy frame props before the changes.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -471,7 +471,8 @@ static QSVFrame *submit_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *p · 470 unmodified lines | |||
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | /* get the output surface */ | 473 | /* 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) | ||
| 475 | { | 476 | { |
| 476 | FilterLink *l = ff_filter_link(outlink); | 477 | FilterLink *l = ff_filter_link(outlink); |
| 477 | AVFilterContext *ctx = outlink->src; | 478 | AVFilterContext *ctx = outlink->src; |
| @@ -513,6 +514,15 @@ static QSVFrame *query_frame(QSVVPPContext *s, AVFilterLink *outlink, const AVFr · 35 unmodified lines | |||
| 513 | return NULL; | 514 | return NULL; |
| 514 | } | 515 | } |
| 515 | 516 | ||
| 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 | |||
| 516 | if (l->frame_rate.num && l->frame_rate.den) | 526 | if (l->frame_rate.num && l->frame_rate.den) |
| 517 | out_frame->frame->duration = av_rescale_q(1, av_inv_q(l->frame_rate), outlink->time_base); | 527 | out_frame->frame->duration = av_rescale_q(1, av_inv_q(l->frame_rate), outlink->time_base); |
| 518 | else | 528 | else |
| @@ -985,7 +995,7 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr · 466 unmodified lines | |||
| 985 | } | 995 | } |
| 986 | 996 | ||
| 987 | do { | 997 | do { |
| 988 | out_frame = query_frame(s, outlink, in_frame->frame); | 998 | out_frame = query_frame(s, outlink, in_frame->frame, propref); |
| 989 | if (!out_frame) { | 999 | if (!out_frame) { |
| 990 | av_log(ctx, AV_LOG_ERROR, "Failed to query an output frame.\n"); | 1000 | av_log(ctx, AV_LOG_ERROR, "Failed to query an output frame.\n"); |
| 991 | return AVERROR(ENOMEM); | 1001 | return AVERROR(ENOMEM); |
| @@ -1009,15 +1019,6 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr · 17 unmodified lines | |||
| 1009 | break; | 1019 | break; |
| 1010 | } | 1020 | } |
| 1011 | 1021 | ||
| 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 | |||
| 1021 | out_frame->frame->pts = av_rescale_q(out_frame->surface.Data.TimeStamp, | 1022 | out_frame->frame->pts = av_rescale_q(out_frame->surface.Data.TimeStamp, |
| 1022 | default_tb, outlink->time_base); | 1023 | default_tb, outlink->time_base); |
| 1023 | 1024 | ||