Commit 7cec1ea2 authored by Rémi Duraffort's avatar Rémi Duraffort Committed by Jean-Baptiste Kempf

Quit correctly x264 codec when x264 failed.

(cherry picked from commit e4bbb16b)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 45d3dd4b
...@@ -802,6 +802,7 @@ static int Open ( vlc_object_t *p_this ) ...@@ -802,6 +802,7 @@ static int Open ( vlc_object_t *p_this )
return VLC_ENOMEM; return VLC_ENOMEM;
p_sys->i_interpolated_dts = 0; p_sys->i_interpolated_dts = 0;
p_sys->psz_stat_name = NULL; p_sys->psz_stat_name = NULL;
p_sys->p_buffer = NULL;
x264_param_default( &p_sys->param ); x264_param_default( &p_sys->param );
p_sys->param.i_width = p_enc->fmt_in.video.i_width; p_sys->param.i_width = p_enc->fmt_in.video.i_width;
...@@ -1306,6 +1307,7 @@ static int Open ( vlc_object_t *p_this ) ...@@ -1306,6 +1307,7 @@ static int Open ( vlc_object_t *p_this )
if( p_sys->h == NULL ) if( p_sys->h == NULL )
{ {
msg_Err( p_enc, "cannot open x264 encoder" ); msg_Err( p_enc, "cannot open x264 encoder" );
Close( VLC_OBJECT(p_enc) );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -1445,6 +1447,7 @@ static void Close( vlc_object_t *p_this ) ...@@ -1445,6 +1447,7 @@ static void Close( vlc_object_t *p_this )
free( p_sys->psz_stat_name ); free( p_sys->psz_stat_name );
if( p_sys->h )
x264_encoder_close( p_sys->h ); x264_encoder_close( p_sys->h );
#ifdef PTW32_STATIC_LIB #ifdef PTW32_STATIC_LIB
......
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