History

avcodec/mpegpicture: Improve error messages and code

Make it clear that this is not a failure of get_buffer/the user, but a deficit of mpegvideo.

Andreas Rheinhardt committed 3 years ago

Commit 042117d1 parent 8c59b5a1 file · +5 −6Browse files

Unified · Split

libavcodec/mpegpicture.c+5−6
@@ -102,20 +102,19 @@ static int handle_pic_linesizes(AVCodecContext *avctx, Picture *pic, · 101 unmodified lines
102102
103103 if ((linesize && linesize != pic->f->linesize[0]) ||
104104 (uvlinesize && uvlinesize != pic->f->linesize[1])) {
105− av_log(avctx, AV_LOG_ERROR,
106− "get_buffer() failed (stride changed: linesize=%d/%d uvlinesize=%d/%d)\n",
105+ av_log(avctx, AV_LOG_ERROR, "Stride change unsupported: "
106+ "linesize=%d/%d uvlinesize=%d/%d)\n",
107107 linesize, pic->f->linesize[0],
108108 uvlinesize, pic->f->linesize[1]);
109109 ff_mpeg_unref_picture(pic);
110− return -1;
110+ return AVERROR_PATCHWELCOME;
111111 }
112112
113113 if (av_pix_fmt_count_planes(pic->f->format) > 2 &&
114114 pic->f->linesize[1] != pic->f->linesize[2]) {
115− av_log(avctx, AV_LOG_ERROR,
116− "get_buffer() failed (uv stride mismatch)\n");
115+ av_log(avctx, AV_LOG_ERROR, "uv stride mismatch unsupported\n");
117116 ff_mpeg_unref_picture(pic);
118− return -1;
117+ return AVERROR_PATCHWELCOME;
119118 }
120119
121120 ret = ff_mpeg_framesize_alloc(avctx, me, sc,

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