mirror of https://github.com/mpv-player/mpv
setting vf_inited flag, some printf->mp_msg, some MSGL_FATAL->MSGL_WARN
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5926 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
e792742f6a
commit
7026f5f9ab
|
@ -136,6 +136,7 @@ void uninit_video(sh_video_t *sh_video){
|
||||||
|
|
||||||
int init_video(sh_video_t *sh_video,char* codecname,int vfm,int status){
|
int init_video(sh_video_t *sh_video,char* codecname,int vfm,int status){
|
||||||
sh_video->codec=NULL;
|
sh_video->codec=NULL;
|
||||||
|
sh_video->vf_inited=0;
|
||||||
while((sh_video->codec=find_codec(sh_video->format,
|
while((sh_video->codec=find_codec(sh_video->format,
|
||||||
sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,
|
sh_video->bih?((unsigned int*) &sh_video->bih->biCompression):NULL,
|
||||||
sh_video->codec,0) )){
|
sh_video->codec,0) )){
|
||||||
|
@ -151,14 +152,14 @@ int init_video(sh_video_t *sh_video,char* codecname,int vfm,int status){
|
||||||
if(mpcodecs_vd_drivers[i]->info->id==sh_video->codec->driver) break;
|
if(mpcodecs_vd_drivers[i]->info->id==sh_video->codec->driver) break;
|
||||||
mpvdec=mpcodecs_vd_drivers[i];
|
mpvdec=mpcodecs_vd_drivers[i];
|
||||||
if(!mpvdec){ // driver not available (==compiled in)
|
if(!mpvdec){ // driver not available (==compiled in)
|
||||||
mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Requested video codec family [%s] (vfm=%d) not available (enable it at compile time!)\n",
|
mp_msg(MSGT_DECVIDEO,MSGL_WARN,"Requested video codec family [%s] (vfm=%d) not available (enable it at compile time!)\n",
|
||||||
sh_video->codec->name, sh_video->codec->driver);
|
sh_video->codec->name, sh_video->codec->driver);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// it's available, let's try to init!
|
// it's available, let's try to init!
|
||||||
printf("Opening Video Decoder: [%s] %s\n",mpvdec->info->short_name,mpvdec->info->name);
|
mp_msg(MSGT_DECVIDEO,MSGL_INFO,"Opening Video Decoder: [%s] %s\n",mpvdec->info->short_name,mpvdec->info->name);
|
||||||
if(!mpvdec->init(sh_video)){
|
if(!mpvdec->init(sh_video)){
|
||||||
printf("VDecoder init failed :(\n");
|
mp_msg(MSGT_DECVIDEO,MSGL_INFO,"VDecoder init failed :(\n");
|
||||||
continue; // try next...
|
continue; // try next...
|
||||||
}
|
}
|
||||||
// Yeah! We got it!
|
// Yeah! We got it!
|
||||||
|
|
|
@ -137,7 +137,7 @@ int mpcodecs_config_vo(sh_video_t *sh, int w, int h, unsigned int preferred_outf
|
||||||
mp_msg(MSGT_DECVIDEO,MSGL_INFO,"VDec: vo config request - %d x %d, %s \n",
|
mp_msg(MSGT_DECVIDEO,MSGL_INFO,"VDec: vo config request - %d x %d, %s \n",
|
||||||
w,h,vo_format_name(preferred_outfmt));
|
w,h,vo_format_name(preferred_outfmt));
|
||||||
|
|
||||||
if(!vf) return 1; // temp hack
|
// if(!vf) return 1; // temp hack
|
||||||
|
|
||||||
if(get_video_quality_max(sh)<=0 && divx_quality){
|
if(get_video_quality_max(sh)<=0 && divx_quality){
|
||||||
// user wants postprocess but no pp filter yet:
|
// user wants postprocess but no pp filter yet:
|
||||||
|
@ -167,7 +167,8 @@ csp_again:
|
||||||
vf=vf_open_filter(vf,"scale",NULL);
|
vf=vf_open_filter(vf,"scale",NULL);
|
||||||
goto csp_again;
|
goto csp_again;
|
||||||
}
|
}
|
||||||
mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_VOincompCodec);
|
mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_VOincompCodec);
|
||||||
|
sh->vf_inited=-1;
|
||||||
return 0; // failed
|
return 0; // failed
|
||||||
}
|
}
|
||||||
out_fmt=sh->codec->outfmt[j];
|
out_fmt=sh->codec->outfmt[j];
|
||||||
|
@ -262,19 +263,12 @@ csp_again:
|
||||||
fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3),
|
fullscreen|(vidmode<<1)|(softzoom<<2)|(flip<<3),
|
||||||
out_fmt)==0){
|
out_fmt)==0){
|
||||||
// "MPlayer",out_fmt,&vtune)){
|
// "MPlayer",out_fmt,&vtune)){
|
||||||
mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_CannotInitVO);
|
mp_msg(MSGT_CPLAYER,MSGL_WARN,MSGTR_CannotInitVO);
|
||||||
return 0; // exit_player(MSGTR_Exit_error);
|
sh->vf_inited=-1;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
sh->vf_inited=1;
|
||||||
#define FREE_MPI(mpi) if(mpi){if(mpi->flags&MP_IMGFLAG_ALLOCATED) free(mpi->planes[0]); free(mpi); mpi=NULL;}
|
|
||||||
FREE_MPI(static_images[0])
|
|
||||||
FREE_MPI(static_images[1])
|
|
||||||
FREE_MPI(temp_images[0])
|
|
||||||
FREE_MPI(export_images[0])
|
|
||||||
#undef FREE_MPI
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue