Commit aca40fdc authored by Rafaël Carré's avatar Rafaël Carré

avformat mux: use avformat_write_header()

Pass its error output to msg_Err with %m
parent 91899a03
...@@ -363,11 +363,18 @@ static int Mux( sout_mux_t *p_mux ) ...@@ -363,11 +363,18 @@ static int Mux( sout_mux_t *p_mux )
if( p_sys->b_write_header ) if( p_sys->b_write_header )
{ {
int error;
msg_Dbg( p_mux, "writing header" ); msg_Dbg( p_mux, "writing header" );
if( av_write_header( p_sys->oc ) < 0 ) #if (LIBAVFORMAT_VERSION_INT >= ((53<<16)+(2<<8)+0))
error = avformat_write_header( p_sys->oc, NULL /* options */ );
#else
error = av_write_header( p_sys->oc );
#endif
if( error < 0 )
{ {
msg_Err( p_mux, "could not write header" ); errno = AVUNERROR(error);
msg_Err( p_mux, "could not write header: %m" );
p_sys->b_write_header = false; p_sys->b_write_header = false;
p_sys->b_error = true; p_sys->b_error = true;
return VLC_EGENERIC; return VLC_EGENERIC;
......
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