changeset 5124:3dcbf67c0de0

handle error from mpcodecs_config_vo()
author arpi
date Sat, 16 Mar 2002 01:10:31 +0000
parents f999c7c4b08c
children 5f82ade9c677
files 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
diffstat 20 files changed, 22 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_cinepak.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_cinepak.c	Sat Mar 16 01:10:31 2002 +0000
@@ -22,14 +22,12 @@
     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
--- a/libmpcodecs/vd_cyuv.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_cyuv.c	Sat Mar 16 01:10:31 2002 +0000
@@ -24,8 +24,7 @@
 
 // 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
--- a/libmpcodecs/vd_divx4.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_divx4.c	Sat Mar 16 01:10:31 2002 +0000
@@ -74,9 +74,10 @@
     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;
--- a/libmpcodecs/vd_dshow.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_dshow.c	Sat Mar 16 01:10:31 2002 +0000
@@ -57,7 +57,7 @@
         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:
--- a/libmpcodecs/vd_ffmpeg.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Sat Mar 16 01:10:31 2002 +0000
@@ -71,8 +71,7 @@
         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
--- a/libmpcodecs/vd_fli.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_fli.c	Sat Mar 16 01:10:31 2002 +0000
@@ -35,7 +35,7 @@
 
 // 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;
 }
--- a/libmpcodecs/vd_ijpg.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_ijpg.c	Sat Mar 16 01:10:31 2002 +0000
@@ -159,7 +159,7 @@
   {
    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 );
--- a/libmpcodecs/vd_libmpeg2.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_libmpeg2.c	Sat Mar 16 01:10:31 2002 +0000
@@ -38,8 +38,7 @@
     // 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
--- a/libmpcodecs/vd_mpng.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_mpng.c	Sat Mar 16 01:10:31 2002 +0000
@@ -109,7 +109,7 @@
  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
--- a/libmpcodecs/vd_msvidc.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_msvidc.c	Sat Mar 16 01:10:31 2002 +0000
@@ -24,8 +24,7 @@
 
 // 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
--- a/libmpcodecs/vd_nuv.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_nuv.c	Sat Mar 16 01:10:31 2002 +0000
@@ -24,8 +24,7 @@
 
 // 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
--- a/libmpcodecs/vd_odivx.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_odivx.c	Sat Mar 16 01:10:31 2002 +0000
@@ -118,8 +118,7 @@
     
     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
--- a/libmpcodecs/vd_qtrle.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_qtrle.c	Sat Mar 16 01:10:31 2002 +0000
@@ -33,8 +33,7 @@
     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
--- a/libmpcodecs/vd_qtrpza.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_qtrpza.c	Sat Mar 16 01:10:31 2002 +0000
@@ -22,12 +22,9 @@
     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
--- a/libmpcodecs/vd_qtsmc.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_qtsmc.c	Sat Mar 16 01:10:31 2002 +0000
@@ -31,8 +31,7 @@
 	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
--- a/libmpcodecs/vd_raw.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_raw.c	Sat Mar 16 01:10:31 2002 +0000
@@ -40,8 +40,7 @@
 	    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
--- a/libmpcodecs/vd_rle.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_rle.c	Sat Mar 16 01:10:31 2002 +0000
@@ -24,7 +24,7 @@
 
 // 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;
--- a/libmpcodecs/vd_roqvideo.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_roqvideo.c	Sat Mar 16 01:10:31 2002 +0000
@@ -27,8 +27,7 @@
 // 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
--- a/libmpcodecs/vd_vfw.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_vfw.c	Sat Mar 16 01:10:31 2002 +0000
@@ -54,9 +54,7 @@
     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
--- a/libmpcodecs/vd_xanim.c	Fri Mar 15 23:53:58 2002 +0000
+++ b/libmpcodecs/vd_xanim.c	Sat Mar 16 01:10:31 2002 +0000
@@ -28,7 +28,7 @@
 
 // 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]);
 }