diff options
author | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-07-16 00:56:12 +0000 |
---|---|---|
committer | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-07-16 00:56:12 +0000 |
commit | c540ebd14b894b92c637915eeb1018953d0c04b7 (patch) | |
tree | 0fea30b10ff1448f53173a3becce2c73dd394480 /libmpcodecs | |
parent | 5358f5a60fec79a9e14e1b09e51558709834f047 (diff) | |
download | mpv-c540ebd14b894b92c637915eeb1018953d0c04b7.tar.bz2 mpv-c540ebd14b894b92c637915eeb1018953d0c04b7.tar.xz |
10l (init flags after init ...)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6740 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index fa99a596ca..23da611b66 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -57,6 +57,8 @@ typedef struct { #include "cfgparser.h" +static void get_buffer(struct AVCodecContext *avctx, int width, int height, int pict_type); + static int lavc_param_workaround_bugs=0; static int lavc_param_error_resilience=0; static int lavc_param_gray=0; @@ -77,14 +79,24 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){ vd_ffmpeg_ctx *ctx = sh->context; switch(cmd){ case VDCTRL_QUERY_FORMAT: - if( (*((int*)arg)) == IMGFMT_YV12 ) return CONTROL_TRUE; - if( (*((int*)arg)) == IMGFMT_IYUV ) return CONTROL_TRUE; - if( (*((int*)arg)) == IMGFMT_I420 ) return CONTROL_TRUE; - if( (*((int*)arg)) == IMGFMT_YUY2 && ctx->yuy2_support ) return CONTROL_TRUE; + switch(*((int*)arg)){ + case IMGFMT_YV12: + case IMGFMT_IYUV: + case IMGFMT_I420: + if(ctx->yuy2_support || ctx->yvu9_support) return CONTROL_FALSE; + else return CONTROL_TRUE; + case IMGFMT_YUY2: + if(ctx->yuy2_support) return CONTROL_TRUE; + return CONTROL_FALSE; #if LIBAVCODEC_BUILD >= 4615 - if( (*((int*)arg)) == IMGFMT_YVU9 && ctx->yvu9_support ) return CONTROL_TRUE; + case IMGFMT_YVU9: + if(ctx->yvu9_support) return CONTROL_TRUE; + return CONTROL_FALSE; #endif - return CONTROL_FALSE; + default: + return CONTROL_FALSE; + + } } return CONTROL_UNKNOWN; } @@ -123,6 +135,13 @@ static int init(sh_video_t *sh){ ctx->avctx = malloc(sizeof(AVCodecContext)); memset(ctx->avctx, 0, sizeof(AVCodecContext)); avctx = ctx->avctx; + +#if LIBAVCODEC_BUILD > 4615 + if(ctx->do_dr1){ + avctx->flags|= CODEC_FLAG_EMU_EDGE | CODEC_FLAG_DR1; + avctx->get_buffer_callback= get_buffer; + } +#endif avctx->width = sh->disp_w; avctx->height= sh->disp_h; @@ -326,13 +345,6 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ } } -#if LIBAVCODEC_BUILD > 4615 - if(dr1){ - avctx->flags|= CODEC_FLAG_EMU_EDGE | CODEC_FLAG_DR1; - avctx->get_buffer_callback= get_buffer; - } -#endif - #if LIBAVCODEC_BUILD > 4603 avctx->hurry_up=(flags&3)?((flags&2)?2:1):0; #endif |