Commit 9d5f86c0 authored by Rafaël Carré's avatar Rafaël Carré

avformat mux: use avformat_free_context()

parent 8f940d81
...@@ -172,17 +172,17 @@ void CloseMux( vlc_object_t *p_this ) ...@@ -172,17 +172,17 @@ void CloseMux( vlc_object_t *p_this )
{ {
sout_mux_t *p_mux = (sout_mux_t*)p_this; sout_mux_t *p_mux = (sout_mux_t*)p_this;
sout_mux_sys_t *p_sys = p_mux->p_sys; sout_mux_sys_t *p_sys = p_mux->p_sys;
unsigned int i;
if( !p_sys->b_write_header && av_write_trailer( p_sys->oc ) < 0 ) if( !p_sys->b_write_header && av_write_trailer( p_sys->oc ) < 0 )
{ {
msg_Err( p_mux, "could not write trailer" ); msg_Err( p_mux, "could not write trailer" );
} }
/* XXX : use avformat_free_context() */ #if( LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( 52, 96, 0 ) )
for( i = 0 ; i < p_sys->oc->nb_streams; i++ ) avformat_context_free(p_sys->oc);
#else
for( unsigned i = 0 ; i < p_sys->oc->nb_streams; i++ )
{ {
if( p_sys->oc->streams[i]->codec->extradata )
av_free( p_sys->oc->streams[i]->codec->extradata ); av_free( p_sys->oc->streams[i]->codec->extradata );
av_free( p_sys->oc->streams[i]->codec ); av_free( p_sys->oc->streams[i]->codec );
#if( LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( 50, 32, 3 ) ) #if( LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT( 50, 32, 3 ) )
...@@ -192,6 +192,7 @@ void CloseMux( vlc_object_t *p_this ) ...@@ -192,6 +192,7 @@ void CloseMux( vlc_object_t *p_this )
} }
av_free( p_sys->oc->streams ); av_free( p_sys->oc->streams );
av_free( p_sys->oc ); av_free( p_sys->oc );
#endif
free( p_sys->io_buffer ); free( p_sys->io_buffer );
free( p_sys ); free( p_sys );
......
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