[vlc-commits] avformat mux: use avformat_write_header()

Rafaël Carré git at videolan.org
Sun Jan 29 06:32:06 CET 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sun Jan 29 00:22:50 2012 -0500| [aca40fdc52ae97e3a188d55af74a0b734b415664] | committer: Rafaël Carré

avformat mux: use avformat_write_header()

Pass its error output to msg_Err with %m

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aca40fdc52ae97e3a188d55af74a0b734b415664
---

 modules/demux/avformat/mux.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/modules/demux/avformat/mux.c b/modules/demux/avformat/mux.c
index 5891fb5..0175430 100644
--- a/modules/demux/avformat/mux.c
+++ b/modules/demux/avformat/mux.c
@@ -363,11 +363,18 @@ static int Mux( sout_mux_t *p_mux )
 
     if( p_sys->b_write_header )
     {
+        int error;
         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_error = true;
             return VLC_EGENERIC;



More information about the vlc-commits mailing list