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
807807 filter_ret = s->filter_frame(outlink, tmp->frame);
808808 if (filter_ret < 0) {
809809 av_frame_free(&tmp->frame);
810− ret = filter_ret;
811− break;
810+ return filter_ret;
812811 }
813812 tmp->queued--;
814813 s->got_frame = 1;
@@ -842,7 +841,7 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr · 27 unmodified lines
842841 if (ret < 0 && ret != MFX_ERR_MORE_SURFACE) {
843842 /* Ignore more_data error */
844843 if (ret == MFX_ERR_MORE_DATA)
845− ret = AVERROR(EAGAIN);
844+ return AVERROR(EAGAIN);
846845 break;
847846 }
848847 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
864863 filter_ret = s->filter_frame(outlink, tmp->frame);
865864 if (filter_ret < 0) {
866865 av_frame_free(&tmp->frame);
867− ret = filter_ret;
868− break;
866+ return filter_ret;
869867 }
870868
871869 tmp->queued--;
@@ -874,5 +872,10 @@ int ff_qsvvpp_filter_frame(QSVVPPContext *s, AVFilterLink *inlink, AVFrame *picr · 2 unmodified lines
874872 }
875873 } while(ret == MFX_ERR_MORE_SURFACE);
876874
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;
878881 }

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