diff --git a/libmpcodecs/vd.c b/libmpcodecs/vd.c index 64ffc48e80..f8d74fafe1 100644 --- a/libmpcodecs/vd.c +++ b/libmpcodecs/vd.c @@ -123,6 +123,18 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outf int screen_size_y=0;//SCREEN_SIZE_Y; vo_functions_t* video_out=sh->video_out; +#if 1 + if(!(sh->disp_w && sh->disp_h)) + mp_msg(MSGT_DECVIDEO,MSGL_WARN, + "VDec: codec didn't set sh->disp_w and sh->disp_h, trying to workaround!\n"); + /* XXX: HACK, if sh->disp_* aren't set, + * but we have w and h, set them :: atmos */ + if(!sh->disp_w && w) + sh->disp_w=w; + if(!sh->disp_h && h) + sh->disp_h=h; +#endif + mp_msg(MSGT_DECVIDEO,MSGL_INFO,"VDec: vo config request - %d x %d, %s \n", w,h,vo_format_name(preferred_outfmt)); diff --git a/libmpcodecs/vd_ijpg.c b/libmpcodecs/vd_ijpg.c index 0a89500173..2cacedafc5 100644 --- a/libmpcodecs/vd_ijpg.c +++ b/libmpcodecs/vd_ijpg.c @@ -133,8 +133,6 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ if ( len <= 0 ) return NULL; // skipped frame - cinfo.err=jpeg_std_error( &jerr.pub ); - jerr.pub.error_exit=my_error_exit; if( setjmp( jerr.setjmp_buffer ) ) { mp_msg( MSGT_DECVIDEO,MSGL_ERR,"[ijpg] setjmp error ...\n" ); @@ -144,8 +142,8 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ jpeg_create_decompress( &cinfo ); jpeg_buf_src( &cinfo,data,len ); jpeg_read_header( &cinfo,TRUE ); - width=cinfo.image_width; - height=cinfo.image_height; + sh->disp_w=width=cinfo.image_width; + sh->disp_h=height=cinfo.image_height; jpeg_start_decompress( &cinfo ); depth=cinfo.output_components * 8;