You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
avcodec/videotoolboxenc: improve Lock/Unlock BaseAddress error handling
1. Fix continue after CVPixelBufferLockBaseAddress. 2. Remove redundant "Error: " in error message.
This commit is contained in:
@@ -2414,12 +2414,8 @@ static int copy_avframe_to_pixel_buffer(AVCodecContext *avctx,
|
|||||||
|
|
||||||
status = CVPixelBufferLockBaseAddress(cv_img, 0);
|
status = CVPixelBufferLockBaseAddress(cv_img, 0);
|
||||||
if (status) {
|
if (status) {
|
||||||
av_log(
|
av_log(avctx, AV_LOG_ERROR, "Could not lock base address of CVPixelBuffer: %d.\n", status);
|
||||||
avctx,
|
return AVERROR_EXTERNAL;
|
||||||
AV_LOG_ERROR,
|
|
||||||
"Error: Could not lock base address of CVPixelBuffer: %d.\n",
|
|
||||||
status
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CVPixelBufferIsPlanar(cv_img)) {
|
if (CVPixelBufferIsPlanar(cv_img)) {
|
||||||
@@ -2481,7 +2477,7 @@ static int copy_avframe_to_pixel_buffer(AVCodecContext *avctx,
|
|||||||
|
|
||||||
status = CVPixelBufferUnlockBaseAddress(cv_img, 0);
|
status = CVPixelBufferUnlockBaseAddress(cv_img, 0);
|
||||||
if (status) {
|
if (status) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Error: Could not unlock CVPixelBuffer base address: %d.\n", status);
|
av_log(avctx, AV_LOG_ERROR, "Could not unlock CVPixelBuffer base address: %d.\n", status);
|
||||||
return AVERROR_EXTERNAL;
|
return AVERROR_EXTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user