The function ff_qsvvpp_filter_frame should return a FFmpeg error code if there is an error. However it might return a SDK error code without this patch.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -807,8 +807,7 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr · 806 unmodified lines | ||
| 807 | 807 | filter_ret = s->filter_frame(outlink, tmp->frame); |
| 808 | 808 | if (filter_ret < 0) { |
| 809 | 809 | av_frame_free(&tmp->frame); |
| 810 | − ret = filter_ret; | |
| 811 | − break; | |
| 810 | + return filter_ret; | |
| 812 | 811 | } |
| 813 | 812 | tmp->queued--; |
| 814 | 813 | s->got_frame = 1; |
| @@ -842,7 +841,7 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr · 27 unmodified lines | ||
| 842 | 841 | if (ret < 0 && ret != MFX_ERR_MORE_SURFACE) { |
| 843 | 842 | /* Ignore more_data error */ |
| 844 | 843 | if (ret == MFX_ERR_MORE_DATA) |
| 845 | − ret = AVERROR(EAGAIN); | |
| 844 | + return AVERROR(EAGAIN); | |
| 846 | 845 | break; |
| 847 | 846 | } |
| 848 | 847 | out_frame->frame->pts = av_rescale_q(out_frame->surface.Data.TimeStamp, |
| @@ -864,8 +863,7 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr · 15 unmodified lines | ||
| 864 | 863 | filter_ret = s->filter_frame(outlink, tmp->frame); |
| 865 | 864 | if (filter_ret < 0) { |
| 866 | 865 | av_frame_free(&tmp->frame); |
| 867 | − ret = filter_ret; | |
| 868 | − break; | |
| 866 | + return filter_ret; | |
| 869 | 867 | } |
| 870 | 868 | |
| 871 | 869 | tmp->queued--; |
| @@ -874,5 +872,10 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr · 2 unmodified lines | ||
| 874 | 872 | } |
| 875 | 873 | } while(ret == MFX_ERR_MORE_SURFACE); |
| 876 | 874 | |
| 877 | − return ret; | |
| 875 | + if (ret < 0) | |
| 876 | + return ff_qsvvpp_print_error(ctx, ret, "Error running VPP"); | |
| 877 | + else if (ret > 0) | |
| 878 | + ff_qsvvpp_print_warning(ctx, ret, "Warning in running VPP"); | |
| 879 | + | |
| 880 | + return 0; | |
| 878 | 881 | } |