# HG changeset patch # User reimar # Date 1267651951 0 # Node ID 1c38d10731ab58071583b96321f8858d59283c29 # Parent 1b4d24af52a70a18efa94a45b3902a54b812bc41 Partially revert r30645, the final output format is determined by mpcodecs_config_vo so we need to query it afterwards. Still try to set a more sensible, codec-dependant preferred format even though it is currently ignored. Fixes bug #1659, based on patch by Andrew Wason [rectalogic rectalogic com] diff -r 1b4d24af52a7 -r 1c38d10731ab libmpcodecs/vd_dmo.c --- a/libmpcodecs/vd_dmo.c Wed Mar 03 21:01:57 2010 +0000 +++ b/libmpcodecs/vd_dmo.c Wed Mar 03 21:32:31 2010 +0000 @@ -55,7 +55,7 @@ // init driver static int init(sh_video_t *sh){ - unsigned int out_fmt=sh->codec->outfmt[sh->outfmtidx]; + unsigned int out_fmt=sh->codec->outfmt[0]; struct context *ctx; void *decoder; if(!(decoder=DMO_VideoDecoder_Open(sh->codec->dll,&sh->codec->guid, sh->bih, 0, 0))){ @@ -64,6 +64,8 @@ return 0; } if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,out_fmt)) return 0; + // mpcodecs_config_vo can change the format + out_fmt=sh->codec->outfmt[sh->outfmtidx]; sh->context = ctx = calloc(1, sizeof(*ctx)); ctx->decoder = decoder; switch(out_fmt){ diff -r 1b4d24af52a7 -r 1c38d10731ab libmpcodecs/vd_dshow.c --- a/libmpcodecs/vd_dshow.c Wed Mar 03 21:01:57 2010 +0000 +++ b/libmpcodecs/vd_dshow.c Wed Mar 03 21:32:31 2010 +0000 @@ -66,7 +66,7 @@ // init driver static int init(sh_video_t *sh){ - unsigned int out_fmt=sh->codec->outfmt[sh->outfmtidx]; + unsigned int out_fmt=sh->codec->outfmt[0]; /* Hack for VSSH codec: new dll can't decode old files * In my samples old files have no extradata, so use that info @@ -81,6 +81,8 @@ return 0; } if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,out_fmt)) return 0; + // mpcodecs_config_vo can change the format + out_fmt=sh->codec->outfmt[sh->outfmtidx]; switch(out_fmt){ case IMGFMT_YUY2: case IMGFMT_UYVY: