forked from FFmpeg/FFmpeg
avfilter/vidstab: check bytesPerPixel only for packed formats.
libvidstab introduced this variable only for packed formats but in vf_vidstab*.c, it's checked for all inputs. So the filter errors out for YUV422/444P streams. Fixes #6736. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
383804edd8
commit
e1e89c0695
2 changed files with 4 additions and 2 deletions
|
@ -107,10 +107,11 @@ static int config_input(AVFilterLink *inlink)
|
||||||
VSMotionDetect* md = &(s->md);
|
VSMotionDetect* md = &(s->md);
|
||||||
VSFrameInfo fi;
|
VSFrameInfo fi;
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
||||||
|
int is_planar = desc->flags & AV_PIX_FMT_FLAG_PLANAR;
|
||||||
|
|
||||||
vsFrameInfoInit(&fi, inlink->w, inlink->h,
|
vsFrameInfoInit(&fi, inlink->w, inlink->h,
|
||||||
ff_av2vs_pixfmt(ctx, inlink->format));
|
ff_av2vs_pixfmt(ctx, inlink->format));
|
||||||
if (fi.bytesPerPixel != av_get_bits_per_pixel(desc)/8) {
|
if (!is_planar && fi.bytesPerPixel != av_get_bits_per_pixel(desc)/8) {
|
||||||
av_log(ctx, AV_LOG_ERROR, "pixel-format error: wrong bits/per/pixel, please report a BUG");
|
av_log(ctx, AV_LOG_ERROR, "pixel-format error: wrong bits/per/pixel, please report a BUG");
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,6 +146,7 @@ static int config_input(AVFilterLink *inlink)
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
||||||
|
int is_planar = desc->flags & AV_PIX_FMT_FLAG_PLANAR;
|
||||||
|
|
||||||
VSTransformData *td = &(tc->td);
|
VSTransformData *td = &(tc->td);
|
||||||
|
|
||||||
|
@ -161,7 +162,7 @@ static int config_input(AVFilterLink *inlink)
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fi_src.bytesPerPixel != av_get_bits_per_pixel(desc)/8 ||
|
if ((!is_planar && fi_src.bytesPerPixel != av_get_bits_per_pixel(desc)/8) ||
|
||||||
fi_src.log2ChromaW != desc->log2_chroma_w ||
|
fi_src.log2ChromaW != desc->log2_chroma_w ||
|
||||||
fi_src.log2ChromaH != desc->log2_chroma_h) {
|
fi_src.log2ChromaH != desc->log2_chroma_h) {
|
||||||
av_log(ctx, AV_LOG_ERROR, "pixel-format error: bpp %i<>%i ",
|
av_log(ctx, AV_LOG_ERROR, "pixel-format error: bpp %i<>%i ",
|
||||||
|
|
Loading…
Add table
Reference in a new issue