[vlc-commits] avformat mux: use avformat_write_header()
Rafaël Carré
git at videolan.org
Sun Mar 4 22:42:04 CET 2012
vlc/vlc-2.0 | branch: master | Rafaël Carré <funman at videolan.org> | Sat Mar 3 00:03:11 2012 +0900| [66dbb503805c08b263c8355289200e533b4574cd] | committer: Rafaël Carré
avformat mux: use avformat_write_header()
Pass its error output to msg_Err with %m
(cherry picked from commit aca40fdc52ae97e3a188d55af74a0b734b415664)
Signed-off-by: KO Myung-Hun <komh at chollian.net>
Signed-off-by: Rafaël Carré <funman at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=66dbb503805c08b263c8355289200e533b4574cd
---
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;
More information about the vlc-commits
mailing list