History

lavfi/qsvvpp: do not mix up FFmpeg and SDK error code

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.

Haihao Xiang committed 5 years ago

Commit 43aeeab1 parent 3f924961 file · +9 −6Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/qsvvpp.c+9−6
@@ -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}

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