History

avcodec/videotoolboxenc: fix error code

1. Fix return 0 on error. 2. Fix return OS error code passthrough.

Zhao Zhili committed 3 years ago

Commit 8f35ee81 parent e7aca331 file · +6 −2Browse files

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

Unified · Split

libavcodec/videotoolboxenc.c+6−2
@@ -2555,6 +2555,7 @@ static int vtenc_populate_extradata(AVCodecContext *avctx, · 2554 unmodified lines
25552555 pool = VTCompressionSessionGetPixelBufferPool(vtctx->session);
25562556 if(!pool){
25572557 av_log(avctx, AV_LOG_ERROR, "Error getting pixel buffer pool.\n");
2558+ status = AVERROR_EXTERNAL;
25582559 goto pe_cleanup;
25592560 }
25602561
@@ -2564,6 +2565,7 @@ static int vtenc_populate_extradata(AVCodecContext *avctx, · 3 unmodified lines
25642565
25652566 if(status != kCVReturnSuccess){
25662567 av_log(avctx, AV_LOG_ERROR, "Error creating frame from pool: %d\n", status);
2568+ status = AVERROR_EXTERNAL;
25672569 goto pe_cleanup;
25682570 }
25692571
@@ -2581,7 +2583,7 @@ static int vtenc_populate_extradata(AVCodecContext *avctx, · 11 unmodified lines
25812583 AV_LOG_ERROR,
25822584 "Error sending frame for extradata: %d\n",
25832585 status);
2584−
2586+ status = AVERROR_EXTERNAL;
25852587 goto pe_cleanup;
25862588 }
25872589
@@ -2589,8 +2591,10 @@ static int vtenc_populate_extradata(AVCodecContext *avctx, · 1 unmodified line
25892591 status = VTCompressionSessionCompleteFrames(vtctx->session,
25902592 kCMTimeIndefinite);
25912593
2592− if (status)
2594+ if (status) {
2595+ status = AVERROR_EXTERNAL;
25932596 goto pe_cleanup;
2597+ }
25942598
25952599 status = vtenc_q_pop(vtctx, 0, &buf, NULL);
25962600 if (status) {

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