handle error from mpcodecs_config_vo()
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sat, 16 Mar 2002 01:10:31 +0000 (01:10 +0000)
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sat, 16 Mar 2002 01:10:31 +0000 (01:10 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@5125 b3059339-0415-0410-9bf9-f77b7e298cf2

20 files changed:
libmpcodecs/vd_cinepak.c
libmpcodecs/vd_cyuv.c
libmpcodecs/vd_divx4.c
libmpcodecs/vd_dshow.c
libmpcodecs/vd_ffmpeg.c
libmpcodecs/vd_fli.c
libmpcodecs/vd_ijpg.c
libmpcodecs/vd_libmpeg2.c
libmpcodecs/vd_mpng.c
libmpcodecs/vd_msvidc.c
libmpcodecs/vd_nuv.c
libmpcodecs/vd_odivx.c
libmpcodecs/vd_qtrle.c
libmpcodecs/vd_qtrpza.c
libmpcodecs/vd_qtsmc.c
libmpcodecs/vd_raw.c
libmpcodecs/vd_rle.c
libmpcodecs/vd_roqvideo.c
libmpcodecs/vd_vfw.c
libmpcodecs/vd_xanim.c

index 1c33bb7..ac96918 100644 (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
index aba0d91..9e936b0 100644 (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
index 603111e..5e6f75a 100644 (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;
index b7fa730..a0f8738 100644 (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:
index f226e4c..f66d8c2 100644 (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
index 2f62e4d..0baea4f 100644 (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;
 }
index 4229e02..0a89500 100644 (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 );
index 64587ab..26c72b1 100644 (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
index e7adb81..4689777 100644 (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
index 2e92da7..213deac 100644 (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
index b6cebe2..32bec90 100644 (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
index 4d1d940..5e4ea0c 100644 (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
index 83b309f..0ec9694 100644 (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
index c1ea74f..3f38d8f 100644 (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
index 1dc6ebf..8c5bf16 100644 (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
index 666f70b..1049c65 100644 (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
index b25e28a..ff29c45 100644 (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;
index 5aaf20c..f63b83b 100644 (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
index dfd47be..ca73682 100644 (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
index 85c2ae8..4b4b176 100644 (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]);
 }