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

Unified · Split

libavcodec/videotoolboxenc.c+6−2
@@ -2555,6 +2555,7 @@ static int vtenc_populate_extradata(AVCodecContext *avctx, · 2554 unmodified lines
2555 pool = VTCompressionSessionGetPixelBufferPool(vtctx->session);2555 pool = VTCompressionSessionGetPixelBufferPool(vtctx->session);
2556 if(!pool){2556 if(!pool){
2557 av_log(avctx, AV_LOG_ERROR, "Error getting pixel buffer pool.\n");2557 av_log(avctx, AV_LOG_ERROR, "Error getting pixel buffer pool.\n");
2558 status = AVERROR_EXTERNAL;
2558 goto pe_cleanup;2559 goto pe_cleanup;
2559 }2560 }
2560 2561
@@ -2564,6 +2565,7 @@ static int vtenc_populate_extradata(AVCodecContext *avctx, · 3 unmodified lines
2564 2565
2565 if(status != kCVReturnSuccess){2566 if(status != kCVReturnSuccess){
2566 av_log(avctx, AV_LOG_ERROR, "Error creating frame from pool: %d\n", status);2567 av_log(avctx, AV_LOG_ERROR, "Error creating frame from pool: %d\n", status);
2568 status = AVERROR_EXTERNAL;
2567 goto pe_cleanup;2569 goto pe_cleanup;
2568 }2570 }
2569 2571
@@ -2581,7 +2583,7 @@ static int vtenc_populate_extradata(AVCodecContext *avctx, · 11 unmodified lines
2581 AV_LOG_ERROR,2583 AV_LOG_ERROR,
2582 "Error sending frame for extradata: %d\n",2584 "Error sending frame for extradata: %d\n",
2583 status);2585 status);
2584 2586 status = AVERROR_EXTERNAL;
2585 goto pe_cleanup;2587 goto pe_cleanup;
2586 }2588 }
2587 2589
@@ -2589,8 +2591,10 @@ static int vtenc_populate_extradata(AVCodecContext *avctx, · 1 unmodified line
2589 status = VTCompressionSessionCompleteFrames(vtctx->session,2591 status = VTCompressionSessionCompleteFrames(vtctx->session,
2590 kCMTimeIndefinite);2592 kCMTimeIndefinite);
2591 2593
2592 if (status)2594 if (status) {
2595 status = AVERROR_EXTERNAL;
2593 goto pe_cleanup;2596 goto pe_cleanup;
2597 }
2594 2598
2595 status = vtenc_q_pop(vtctx, 0, &buf, NULL);2599 status = vtenc_q_pop(vtctx, 0, &buf, NULL);
2596 if (status) {2600 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