Commit a0b49d79 authored by Jean-Paul Saman's avatar Jean-Paul Saman

fb: Cleanup properly after failing OpenDisplay.

parent 5d40c7d4
...@@ -361,15 +361,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -361,15 +361,7 @@ static int Create( vlc_object_t *p_this )
if( OpenDisplay( p_vout ) ) if( OpenDisplay( p_vout ) )
{ {
if( p_sys->b_tty ) Destroy( VLC_OBJECT(p_vout) );
{
ioctl( p_sys->i_tty, VT_SETMODE, &p_vout->p_sys->vt_mode );
sigaction( SIGUSR1, &p_vout->p_sys->sig_usr1, NULL );
sigaction( SIGUSR2, &p_vout->p_sys->sig_usr2, NULL );
tcsetattr(0, 0, &p_vout->p_sys->old_termios);
TextMode( p_sys->i_tty );
}
free( p_vout->p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -959,6 +951,8 @@ static void CloseDisplay( vout_thread_t *p_vout ) ...@@ -959,6 +951,8 @@ static void CloseDisplay( vout_thread_t *p_vout )
munmap( p_vout->p_sys->p_video, p_vout->p_sys->i_page_size ); munmap( p_vout->p_sys->p_video, p_vout->p_sys->i_page_size );
} }
if( p_vout->p_sys->i_fd >= 0 )
{
/* Restore palette */ /* Restore palette */
if( p_vout->p_sys->var_info.bits_per_pixel == 8 ) if( p_vout->p_sys->var_info.bits_per_pixel == 8 )
{ {
...@@ -974,6 +968,7 @@ static void CloseDisplay( vout_thread_t *p_vout ) ...@@ -974,6 +968,7 @@ static void CloseDisplay( vout_thread_t *p_vout )
/* Close fb */ /* Close fb */
close( p_vout->p_sys->i_fd ); close( p_vout->p_sys->i_fd );
}
} }
/***************************************************************************** /*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment