[FFmpeg-devel] [PATCH 3/7] avcodec/vc2enc: Remove superfluous error message

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Tue May 28 05:49:08 EEST 2024


ff_get_encode_buffer() already emits an error message of its own.
While just at it, also check for ret < 0 instead of just ret != 0.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/vc2enc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index 4dcf423ef1..f39f368181 100644
--- a/libavcodec/vc2enc.c
+++ b/libavcodec/vc2enc.c
@@ -918,10 +918,8 @@ static int encode_frame(VC2EncContext *s, AVPacket *avpkt, const AVFrame *frame,
     if (field < 2) {
         ret = ff_get_encode_buffer(s->avctx, avpkt,
                                    max_frame_bytes << s->interlaced, 0);
-        if (ret) {
-            av_log(s->avctx, AV_LOG_ERROR, "Error getting output packet.\n");
+        if (ret < 0)
             return ret;
-        }
         init_put_bits(&s->pb, avpkt->data, avpkt->size);
     }
 
-- 
2.40.1



More information about the ffmpeg-devel mailing list