summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-03-03 13:38:33 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-03-03 13:38:33 +0000
commit0f43db17696a857880fb3e639d09aea03c4c0331 (patch)
tree178ac18a4ae1c7438a6c92537328602d0bdc8056 /libmpcodecs
parent380d3ce69671ab04329234e34b0f2e54a72c2590 (diff)
downloadmpv-0f43db17696a857880fb3e639d09aea03c4c0331.tar.bz2
mpv-0f43db17696a857880fb3e639d09aea03c4c0331.tar.xz
Add another hack to work-around the currently completely inconsistent way in
which libavcodec sets AVCodecContext::pix_fmt. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28801 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_ffmpeg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 6f9030e2c3..a35f4ddd2c 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -409,7 +409,8 @@ static int init(sh_video_t *sh){
uninit(sh);
return 0;
}
- // this is necessary in case get_format was never called
+ // this is necessary in case get_format was never called and init_vo is
+ // too late e.g. for H.264 VDPAU
set_format_params(avctx, avctx->pix_fmt);
mp_msg(MSGT_DECVIDEO, MSGL_V, "INFO: libavcodec init OK!\n");
return 1; //mpcodecs_config_vo(sh, sh->disp_w, sh->disp_h, IMGFMT_YV12);
@@ -504,6 +505,9 @@ static int init_vo(sh_video_t *sh, enum PixelFormat pix_fmt){
pix_fmt != ctx->pix_fmt ||
!ctx->vo_initialized)
{
+ // this is a special-case HACK for MPEG-1/2 VDPAU that uses neither get_format nor
+ // sets the value correctly in avcodec_open.
+ set_format_params(avctx, avctx->pix_fmt);
mp_msg(MSGT_DECVIDEO, MSGL_V, "[ffmpeg] aspect_ratio: %f\n", aspect);
if (sh->aspect == 0 ||
av_cmp_q(avctx->sample_aspect_ratio,