changeset 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 ddc587b1fd8b
files mplayer.c
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mplayer.c	Sun Nov 19 10:52:23 2006 +0000
+++ b/mplayer.c	Sun Nov 19 11:21:09 2006 +0000
@@ -3180,7 +3180,7 @@
     //if((video_out->preinit(vo_subdevice))!=0){
     if(!(video_out=init_best_video_out(video_driver_list))){
       mp_msg(MSGT_CPLAYER,MSGL_FATAL,MSGTR_ErrorInitializingVODevice);
-      return 0;
+      goto err_out;
     }
     sh_video->video_out=video_out;
     inited_flags|=INITED_VO;
@@ -3242,8 +3242,7 @@
 
   if(!sh_video->inited){
     if(!fixed_vo) uninit_player(INITED_VO);
-    sh_video = d_video->sh = NULL;
-    return 0;
+    goto err_out;
   }
 
   inited_flags|=INITED_VCODEC;
@@ -3265,6 +3264,10 @@
   current_module="init_vo";
 
   return 1;
+
+err_out:
+  sh_video = d_video->sh = NULL;
+  return 0;
 }
 
 int main(int argc,char* argv[]){
@@ -4298,7 +4301,7 @@
 if(!sh_video) goto main; // audio-only
 
 if(!reinit_video_chain()) {
-  if(!sh_video || !sh_video->inited){
+  if(!sh_video){
     if(!sh_audio) goto goto_next_file;
     goto main; // exit_player(MSGTR_Exit_error);
   }