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 | filter_ret = s->filter_frame(outlink, tmp->frame); | 807 | filter_ret = s->filter_frame(outlink, tmp->frame); |
| 808 | if (filter_ret < 0) { | 808 | if (filter_ret < 0) { |
| 809 | av_frame_free(&tmp->frame); | 809 | av_frame_free(&tmp->frame); |
| 810 | ret = filter_ret; | 810 | return filter_ret; |
| 811 | break; | ||
| 812 | } | 811 | } |
| 813 | tmp->queued--; | 812 | tmp->queued--; |
| 814 | s->got_frame = 1; | 813 | s->got_frame = 1; |
| @@ -842,7 +841,7 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr · 27 unmodified lines | |||
| 842 | if (ret < 0 && ret != MFX_ERR_MORE_SURFACE) { | 841 | if (ret < 0 && ret != MFX_ERR_MORE_SURFACE) { |
| 843 | /* Ignore more_data error */ | 842 | /* Ignore more_data error */ |
| 844 | if (ret == MFX_ERR_MORE_DATA) | 843 | if (ret == MFX_ERR_MORE_DATA) |
| 845 | ret = AVERROR(EAGAIN); | 844 | return AVERROR(EAGAIN); |
| 846 | break; | 845 | break; |
| 847 | } | 846 | } |
| 848 | out_frame->frame->pts = av_rescale_q(out_frame->surface.Data.TimeStamp, | 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 | filter_ret = s->filter_frame(outlink, tmp->frame); | 863 | filter_ret = s->filter_frame(outlink, tmp->frame); |
| 865 | if (filter_ret < 0) { | 864 | if (filter_ret < 0) { |
| 866 | av_frame_free(&tmp->frame); | 865 | av_frame_free(&tmp->frame); |
| 867 | ret = filter_ret; | 866 | return filter_ret; |
| 868 | break; | ||
| 869 | } | 867 | } |
| 870 | 868 | ||
| 871 | tmp->queued--; | 869 | tmp->queued--; |
| @@ -874,5 +872,10 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr · 2 unmodified lines | |||
| 874 | } | 872 | } |
| 875 | } while(ret == MFX_ERR_MORE_SURFACE); | 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 | } |