1
mirror of https://github.com/mpv-player/mpv synced 2024-09-12 23:45:53 +02:00

handle error from mpcodecs_config_vo()

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5125 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-03-16 01:10:31 +00:00
parent 98a08e34c0
commit ce04a5f401
20 changed files with 22 additions and 38 deletions

View File

@ -22,14 +22,12 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
return CONTROL_UNKNOWN;
}
//int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt);
void *decode_cinepak_init(void);
// init driver
static int init(sh_video_t *sh){
sh->context = decode_cinepak_init();
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2);
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2);
}
// uninit driver

View File

@ -24,8 +24,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
// init driver
static int init(sh_video_t *sh){
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_UYVY);
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_UYVY);
}
// uninit driver

View File

@ -74,9 +74,10 @@ static int init(sh_video_t *sh){
DEC_PARAM dec_param;
DEC_SET dec_set;
int bits=16;
memset(&dec_param,0,sizeof(dec_param));
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2);
if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2)) return 0;
memset(&dec_param,0,sizeof(dec_param));
switch(sh->codec->outfmt[sh->outfmtidx]){
case IMGFMT_YV12: dec_param.output_format=DEC_YV12;bits=12;break;

View File

@ -57,7 +57,7 @@ static int init(sh_video_t *sh){
mp_msg(MSGT_DECVIDEO,MSGL_HINT,"package from: ftp://mplayerhq.hu/MPlayer/releases/w32codec.zip !\n");
return 0;
}
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2);
if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2)) return 0;
out_fmt=sh->codec->outfmt[sh->outfmtidx];
switch(out_fmt){
case IMGFMT_YUY2:

View File

@ -71,8 +71,7 @@ static int init(sh_video_t *sh){
return 0;
}
mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: libavcodec init OK!\n");
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
}
// uninit driver

View File

@ -35,7 +35,7 @@ void decode_fli_frame(
// init driver
static int init(sh_video_t *sh){
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24);
if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24)) return 0;
sh->context = init_fli_decoder(sh->disp_w, sh->disp_h);
return 1;
}

View File

@ -159,7 +159,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
{
last_w=width; last_h=height; last_c=out_fmt;
if ( !out_fmt ) return NULL;
mpcodecs_config_vo( sh,width,height,out_fmt );
if(!mpcodecs_config_vo( sh,width,height,out_fmt )) return NULL;
}
mpi=mpcodecs_get_image( sh,MP_IMGTYPE_TEMP,MP_IMGFLAG_ACCEPT_STRIDE,width,height );

View File

@ -38,8 +38,7 @@ static int init(sh_video_t *sh){
// send seq header to the decoder: *** HACK ***
mpeg2_decode_data(NULL,videobuffer,videobuffer+videobuf_len,0);
mpeg2_allocate_image_buffers (picture);
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
}
// uninit driver

View File

@ -109,7 +109,7 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){
if(last_w!=png_width || last_h!=png_height || last_c!=out_fmt){
last_w=png_width; last_h=png_height; last_c=out_fmt;
if(!out_fmt) return NULL;
mpcodecs_config_vo(sh,png_width,png_height,out_fmt);
if(!mpcodecs_config_vo(sh,png_width,png_height,out_fmt)) return NULL;
}
#if 0

View File

@ -24,8 +24,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
// init driver
static int init(sh_video_t *sh){
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24);
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24);
}
// uninit driver

View File

@ -24,8 +24,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
// init driver
static int init(sh_video_t *sh){
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_I420);
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_I420);
}
// uninit driver

View File

@ -118,8 +118,7 @@ static int init(sh_video_t *sh){
mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: OpenDivX video codec init OK!\n");
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
}
// uninit driver

View File

@ -33,8 +33,7 @@ static int init(sh_video_t *sh){
return 0;
}
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24);
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24);
}
// uninit driver

View File

@ -22,12 +22,9 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
return CONTROL_UNKNOWN;
}
//int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outfmt);
// init driver
static int init(sh_video_t *sh){
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR16);
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR16);
}
// uninit driver

View File

@ -31,8 +31,7 @@ static int init(sh_video_t *sh){
return 0;
}
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24);
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24);
}
// uninit driver

View File

@ -40,8 +40,7 @@ static int init(sh_video_t *sh){
mp_msg(MSGT_DECVIDEO,MSGL_WARN,"RAW: depth %d not supported\n",sh->bih->biBitCount);
}
}
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format);
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format);
}
// uninit driver

View File

@ -24,7 +24,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
// init driver
static int init(sh_video_t *sh){
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24);
if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_BGR24)) return 0;
if( (((sh->codec->outfmt[sh->outfmtidx]&255)+7)/8)==2 ){
unsigned int* pal=(unsigned int*)(((char*)sh->bih)+40);
int cols=(sh->bih->biSize-40)/4;

View File

@ -27,8 +27,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
// init driver
static int init(sh_video_t *sh){
sh->context = roq_decode_video_init();
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YV12);
}
// uninit driver

View File

@ -54,9 +54,7 @@ static int init(sh_video_t *sh){
unsigned int out_fmt;
if(!init_vfw_video_codec(sh,(sh->codec->driver==VFM_VFWEX))) return 0;
mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: Win32 video codec init OK!\n");
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2);
// out_fmt=sh->codec->outfmt[sh->outfmtidx];
return 1;
return mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,IMGFMT_YUY2);
}
// uninit driver

View File

@ -28,7 +28,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
// init driver
static int init(sh_video_t *sh){
mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format);
if(!mpcodecs_config_vo(sh,sh->disp_w,sh->disp_h,sh->format)) return 0;
return xacodec_init_video(sh,sh->codec->outfmt[sh->outfmtidx]);
}