# HG changeset patch # User arpi # Date 1016420901 0 # Node ID 7e77d73442087532040e0c1623d7a7927cd875fe # Parent 104cd0571dc454b06abc1aab8af3d93c8afcc36e supports query_format in codecs diff -r 104cd0571dc4 -r 7e77d7344208 libmpcodecs/dec_video.c --- a/libmpcodecs/dec_video.c Mon Mar 18 01:55:38 2002 +0000 +++ b/libmpcodecs/dec_video.c Mon Mar 18 03:08:21 2002 +0000 @@ -41,7 +41,7 @@ int divx_quality=0; -static vd_functions_t* mpvdec=NULL; +vd_functions_t* mpvdec=NULL; int get_video_quality_max(sh_video_t *sh_video){ if(mpvdec){ diff -r 104cd0571dc4 -r 7e77d7344208 libmpcodecs/vd.c --- a/libmpcodecs/vd.c Mon Mar 18 01:55:38 2002 +0000 +++ b/libmpcodecs/vd.c Mon Mar 18 03:08:21 2002 +0000 @@ -108,6 +108,8 @@ static mp_image_t* export_images[1]; static int static_idx=0; +extern vd_functions_t* mpvdec; // FIXME! + int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt){ int i,j; unsigned int out_fmt=0; @@ -127,9 +129,12 @@ if(out_fmt==(signed int)0xFFFFFFFF) continue; vo_flags=video_out->control(VOCTRL_QUERY_FORMAT, &out_fmt); mp_msg(MSGT_CPLAYER,MSGL_DBG2,"vo_debug: query(%s) returned 0x%X (i=%d) \n",vo_format_name(out_fmt),vo_flags,i); - // TODO: check (query) if codec really support this outfmt... - if(vo_flags&2){j=i; break;} - if(vo_flags && j<0) j=i; + if((vo_flags&2) || (vo_flags && j<0)){ + // check (query) if codec really support this outfmt... + if(mpvdec->control(sh,VDCTRL_QUERY_FORMAT,&out_fmt)==CONTROL_FALSE) + continue; + j=i; if(vo_flags&2) break; + } } if(j<0){ // TODO: no match - we should use conversion...