summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-03-27 10:32:52 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-03-27 10:32:52 +0000
commit171de9cf5f7df128635205270363b68f6b1348ef (patch)
treede215212601dbaa0d32f43de335f03b6fedb81d8 /libmpcodecs
parent27542d02aabdc4ba19f5214d78edee5e7a08c6b4 (diff)
downloadmpv-171de9cf5f7df128635205270363b68f6b1348ef.tar.bz2
mpv-171de9cf5f7df128635205270363b68f6b1348ef.tar.xz
reinit vo when pix_fmt changes.
Avoids broken image or even crash with mf://*.jpg and JPGs with different chroma sampling. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17974 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_ffmpeg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 3818c3f0ae..457375bb87 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -58,6 +58,7 @@ int avcodec_inited=0;
typedef struct {
AVCodecContext *avctx;
AVFrame *pic;
+ enum PixelFormat pix_fmt;
float last_aspect;
int do_slices;
int do_dr1;
@@ -533,6 +534,7 @@ static int init_vo(sh_video_t *sh, enum PixelFormat pix_fmt){
if (// aspect != ctx->last_aspect ||
width != sh->disp_w ||
height != sh->disp_h ||
+ pix_fmt != ctx->pix_fmt ||
!ctx->vo_inited)
{
mp_msg(MSGT_DECVIDEO, MSGL_V, "[ffmpeg] aspect_ratio: %f\n", aspect);
@@ -542,6 +544,7 @@ static int init_vo(sh_video_t *sh, enum PixelFormat pix_fmt){
sh->aspect = ctx->last_aspect;
sh->disp_w = width;
sh->disp_h = height;
+ ctx->pix_fmt = pix_fmt;
switch(pix_fmt){
// YUVJ are YUV formats that use the full Y range and not just
// 16 - 235 (see colorspaces.txt).