comparison mplayer.c @ 21031:e45bb0ee5558

Make sure sh_video == NULL when reinit_video_chain fails.
author reimar
date Sun, 19 Nov 2006 11:21:09 +0000
parents 1c6d131163b6
children bfd340cdac88
comparison
equal deleted inserted replaced
21030:1c6d131163b6 21031:e45bb0ee5558
3178 //shouldn't we set dvideo->id=-2 when we fail? 3178 //shouldn't we set dvideo->id=-2 when we fail?
3179 vo_config_count=0; 3179 vo_config_count=0;
3180 //if((video_out->preinit(vo_subdevice))!=0){ 3180 //if((video_out->preinit(vo_subdevice))!=0){
3181 if(!(video_out=init_best_video_out(video_driver_list))){ 3181 if(!(video_out=init_best_video_out(video_driver_list))){
3182 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_ErrorInitializingVODevice); 3182 mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_ErrorInitializingVODevice);
3183 return 0; 3183 goto err_out;
3184 } 3184 }
3185 sh_video->video_out=video_out; 3185 sh_video->video_out=video_out;
3186 inited_flags|=INITED_VO; 3186 inited_flags|=INITED_VO;
3187 } 3187 }
3188 3188
3240 init_best_video_codec(sh_video,video_codec_list,video_fm_list); 3240 init_best_video_codec(sh_video,video_codec_list,video_fm_list);
3241 mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n"); 3241 mp_msg(MSGT_CPLAYER,MSGL_INFO,"==========================================================================\n");
3242 3242
3243 if(!sh_video->inited){ 3243 if(!sh_video->inited){
3244 if(!fixed_vo) uninit_player(INITED_VO); 3244 if(!fixed_vo) uninit_player(INITED_VO);
3245 sh_video = d_video->sh = NULL; 3245 goto err_out;
3246 return 0;
3247 } 3246 }
3248 3247
3249 inited_flags|=INITED_VCODEC; 3248 inited_flags|=INITED_VCODEC;
3250 3249
3251 if (sh_video->codec) 3250 if (sh_video->codec)
3263 // ========== Init display (sh_video->disp_w*sh_video->disp_h/out_fmt) ============ 3262 // ========== Init display (sh_video->disp_w*sh_video->disp_h/out_fmt) ============
3264 3263
3265 current_module="init_vo"; 3264 current_module="init_vo";
3266 3265
3267 return 1; 3266 return 1;
3267
3268 err_out:
3269 sh_video = d_video->sh = NULL;
3270 return 0;
3268 } 3271 }
3269 3272
3270 int main(int argc,char* argv[]){ 3273 int main(int argc,char* argv[]){
3271 3274
3272 3275
4296 mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_LENGTH=%.2lf\n", demuxer_get_time_length(demuxer)); 4299 mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_LENGTH=%.2lf\n", demuxer_get_time_length(demuxer));
4297 4300
4298 if(!sh_video) goto main; // audio-only 4301 if(!sh_video) goto main; // audio-only
4299 4302
4300 if(!reinit_video_chain()) { 4303 if(!reinit_video_chain()) {
4301 if(!sh_video || !sh_video->inited){ 4304 if(!sh_video){
4302 if(!sh_audio) goto goto_next_file; 4305 if(!sh_audio) goto goto_next_file;
4303 goto main; // exit_player(MSGTR_Exit_error); 4306 goto main; // exit_player(MSGTR_Exit_error);
4304 } 4307 }
4305 } 4308 }
4306 4309