[FFmpeg-cvslog] avcodec/audiotoolboxenc: return AVERROR_EXTERNAL immediately when encode error

Steven Liu git at videolan.org
Mon Aug 22 05:58:26 EEST 2022


ffmpeg | branch: master | Steven Liu <lq at chinaffmpeg.org> | Wed Jun 29 00:14:08 2022 +0800| [627543f58a3166810b9cd9c8b483678c82a99be9] | committer: Steven Liu

avcodec/audiotoolboxenc: return AVERROR_EXTERNAL immediately when encode error

Just return AVERROR_EXTERNAL immediately when encode error.
The other logic should keep the old behavior before commit 7c05b7951.

Suggested-By: Zhao Zhili <zhilizhao at tencent.com>
Signed-off-by: Steven Liu <lq at chinaffmpeg.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=627543f58a3166810b9cd9c8b483678c82a99be9
---

 libavcodec/audiotoolboxenc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
index d8cc62423a..7cb7ab6e7e 100644
--- a/libavcodec/audiotoolboxenc.c
+++ b/libavcodec/audiotoolboxenc.c
@@ -554,13 +554,12 @@ static int ffat_encode(AVCodecContext *avctx, AVPacket *avpkt,
                                      avctx->frame_size,
                            &avpkt->pts,
                            &avpkt->duration);
-        ret = 0;
     } else if (ret && ret != 1) {
         av_log(avctx, AV_LOG_ERROR, "Encode error: %i\n", ret);
-        ret = AVERROR_EXTERNAL;
+        return AVERROR_EXTERNAL;
     }
 
-    return ret;
+    return 0;
 }
 
 static av_cold void ffat_encode_flush(AVCodecContext *avctx)



More information about the ffmpeg-cvslog mailing list