[vlc-devel] [PATCH 14/15] avformat mux: use avformat_write_header()
KO Myung-Hun
komh78 at gmail.com
Fri Mar 2 16:03:11 CET 2012
From: Rafaël Carré <funman at videolan.org>
Pass its error output to msg_Err with %m
(cherry picked from commit aca40fdc52ae97e3a188d55af74a0b734b415664)
Signed-off-by: KO Myung-Hun <komh at chollian.net>
---
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 5ead5ac..b12bed1 100644
--- a/modules/demux/avformat/mux.c
+++ b/modules/demux/avformat/mux.c
@@ -356,11 +356,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;
--
1.7.3.2
More information about the vlc-devel
mailing list