Mercurial > mplayer.hg
changeset 36373:3cdf45841125
vd_ffmpeg: catch invalid aspect from FFmpeg.
This avoids endless reinitialization with buggy FFmpeg
codecs like HEVC that set aspect to be n/0, which compares
unequal to itself.
author | reimar |
---|---|
date | Wed, 16 Oct 2013 17:47:16 +0000 |
parents | c95bdc49af2e |
children | cd83754e4f3a |
files | libmpcodecs/vd_ffmpeg.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c Wed Oct 16 17:20:31 2013 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Wed Oct 16 17:47:16 2013 +0000 @@ -568,6 +568,10 @@ static void update_configuration(sh_video_t *sh, enum AVPixelFormat pix_fmt) { vd_ffmpeg_ctx *ctx = sh->context; AVCodecContext *avctx = ctx->avctx; + if (!avctx->sample_aspect_ratio.den) { + mp_msg(MSGT_DECVIDEO, MSGL_WARN, "FFmpeg bug: Invalid aspect\n"); + avctx->sample_aspect_ratio.den = 1; + } // it is possible another vo buffers to be used after vo config() // lavc reset its buffers on width/heigh change but not on aspect change!!! if (av_cmp_q(avctx->sample_aspect_ratio, ctx->last_sample_aspect_ratio) ||