diff mbox series

[FFmpeg-devel,26/57] avcodec/mpegpicture: Improve error messages and code

Message ID AS8P250MB0744B050E0AC8DD0F6D67A308F1B2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State New
Headers show
Series [FFmpeg-devel,01/14] avcodec/get_buffer: Remove redundant check | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Andreas Rheinhardt April 29, 2024, 9:14 p.m. UTC
Make it clear that this is not a failure of get_buffer/the user,
but a deficit of mpegvideo.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpegpicture.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c
index bca0e6de01..d0b529dc37 100644
--- a/libavcodec/mpegpicture.c
+++ b/libavcodec/mpegpicture.c
@@ -102,20 +102,19 @@  static int handle_pic_linesizes(AVCodecContext *avctx, Picture *pic,
 
     if ((linesize   &&   linesize != pic->f->linesize[0]) ||
         (uvlinesize && uvlinesize != pic->f->linesize[1])) {
-        av_log(avctx, AV_LOG_ERROR,
-               "get_buffer() failed (stride changed: linesize=%d/%d uvlinesize=%d/%d)\n",
+        av_log(avctx, AV_LOG_ERROR, "Stride change unsupported: "
+               "linesize=%d/%d uvlinesize=%d/%d)\n",
                linesize,   pic->f->linesize[0],
                uvlinesize, pic->f->linesize[1]);
         ff_mpeg_unref_picture(pic);
-        return -1;
+        return AVERROR_PATCHWELCOME;
     }
 
     if (av_pix_fmt_count_planes(pic->f->format) > 2 &&
         pic->f->linesize[1] != pic->f->linesize[2]) {
-        av_log(avctx, AV_LOG_ERROR,
-               "get_buffer() failed (uv stride mismatch)\n");
+        av_log(avctx, AV_LOG_ERROR, "uv stride mismatch unsupported\n");
         ff_mpeg_unref_picture(pic);
-        return -1;
+        return AVERROR_PATCHWELCOME;
     }
 
     ret = ff_mpeg_framesize_alloc(avctx, me, sc,