mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
wmvenc: check if width is multiple of 2
The width of wmv1/2 video must be multiple of 2 or win32 codec will fail to decode it (WMP displays black screen). Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ca297513f0
commit
6108e1be2f
@ -508,6 +508,14 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
|
|||||||
av_log(avctx, AV_LOG_ERROR, "MPEG-2 does not support resolutions above 16383x16383\n");
|
av_log(avctx, AV_LOG_ERROR, "MPEG-2 does not support resolutions above 16383x16383\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((s->codec_id == CODEC_ID_WMV1 ||
|
||||||
|
s->codec_id == CODEC_ID_WMV2) &&
|
||||||
|
avctx->width & 1) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "width must be multiple of 2\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if ((s->flags & (CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME)) &&
|
if ((s->flags & (CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME)) &&
|
||||||
s->codec_id != CODEC_ID_MPEG4 && s->codec_id != CODEC_ID_MPEG2VIDEO) {
|
s->codec_id != CODEC_ID_MPEG4 && s->codec_id != CODEC_ID_MPEG2VIDEO) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "interlacing not supported by codec\n");
|
av_log(avctx, AV_LOG_ERROR, "interlacing not supported by codec\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user