diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-10-16 04:49:44 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-10-16 05:14:25 +0300 |
commit | 96312757c5d02d663b4d56471cd7b00e0066318f (patch) | |
tree | 40cc37f448291c6173cea6d53ba5fcf049ae4d7d /libmpcodecs | |
parent | 266e0341bafc90b199fa7674a5044ba85428f5bf (diff) | |
download | mpv-96312757c5d02d663b4d56471cd7b00e0066318f.tar.bz2 mpv-96312757c5d02d663b4d56471cd7b00e0066318f.tar.xz |
vd_ffmpeg: fix aspect ratio problems with recent FFmpeg
The code left ctx->last_sample_aspect_ratio at 0/0 when allocating a
context. In older FFmpeg versions av_cmp_q() against 0/0 always said
the numbers are equal; but this changed recently, triggering incorrect
overwrite of container aspect ratio. The logic looks like it'd need
further fixes, but for now just initialize last_sample_aspect_ratio to
0/1; this should restore the previous behavior from before FFmpeg
changes, which worked well enough for the most common cases.
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 89b7fb54c9..db5d53d0df 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -175,6 +175,8 @@ static int init(sh_video_t *sh){ ctx = sh->context = talloc_zero(NULL, vd_ffmpeg_ctx); + ctx->last_sample_aspect_ratio = (AVRational){0, 1}; + lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh->codec->dll); if(!lavc_codec){ mp_tmsg(MSGT_DECVIDEO, MSGL_ERR, "Cannot find codec '%s' in libavcodec...\n", sh->codec->dll); |