aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-19 11:21:09 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-19 11:21:09 +0000
commit8979378150a2ec798fb5838a7dcc85af0a238e0f (patch)
tree5a844fa95784d420ede6f409849c63254d856593
parentc339cf1fe59a916756abe85c8ecbf7319223d4de (diff)
Make sure sh_video == NULL when reinit_video_chain fails.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21047 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--mplayer.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mplayer.c b/mplayer.c
index 17eaae1204..0f6d0ac80e 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -3180,7 +3180,7 @@ static int reinit_video_chain(void) {
//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 @@ static int reinit_video_chain(void) {
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 @@ static int reinit_video_chain(void) {
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 (global_sub_size) {
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);
}