diff options
author | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-06-02 12:48:55 +0000 |
---|---|---|
committer | michael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-06-02 12:48:55 +0000 |
commit | 3efbc894b064d36cd71875e00c906c3db089cd57 (patch) | |
tree | 492c44c43293ddc82a95dca2c6e5a754399dcc55 /libmpcodecs/vd_ffmpeg.c | |
parent | 0d2099109393238bee9aede156657197fc4b062c (diff) | |
download | mpv-3efbc894b064d36cd71875e00c906c3db089cd57.tar.bz2 mpv-3efbc894b064d36cd71875e00c906c3db089cd57.tar.xz |
workaround bugs & error resilience ffmpeg decoder options
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6266 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 7080ebf428..db0d257d8a 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -51,6 +51,19 @@ typedef struct { //unsigned int lavc_pp=0; //#endif +#include "cfgparser.h" + +static int lavc_param_workaround_bugs=0; +static int lavc_param_error_resilience=0; + +struct config lavc_decode_opts_conf[]={ +#if LIBAVCODEC_BUILD >= 4611 + {"bug", &lavc_param_workaround_bugs, CONF_TYPE_INT, CONF_RANGE, 0, 99, NULL}, + {"ver", &lavc_param_error_resilience, CONF_TYPE_INT, CONF_RANGE, -1, 99, NULL}, +#endif + {NULL, NULL, 0, 0, 0, 0, NULL} +}; + // to set/get/query special features/parameters static int control(sh_video_t *sh,int cmd,void* arg,...){ vd_ffmpeg_ctx *ctx = sh->context; @@ -97,6 +110,11 @@ static int init(sh_video_t *sh){ avctx->width = sh->disp_w; avctx->height= sh->disp_h; +#if LIBAVCODEC_BUILD >= 4611 + avctx->workaround_bugs= lavc_param_workaround_bugs; + avctx->error_resilience= lavc_param_error_resilience; +#endif + mp_dbg(MSGT_DECVIDEO,MSGL_DBG2,"libavcodec.size: %d x %d\n",avctx->width,avctx->height); if (sh->format == mmioFOURCC('R', 'V', '1', '3')) avctx->sub_id = 3; @@ -199,10 +217,9 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ ret = avcodec_decode_video(avctx, &lavc_picture, &got_picture, data, len); - if(ret<0) mp_msg(MSGT_DECVIDEO,MSGL_WARN, "Error while decoding frame!\n"); if(!got_picture) return NULL; // skipped image - + if (avctx->aspect_ratio_info != ctx->last_aspect || avctx->width != sh->disp_w || avctx->height != sh->disp_h || |