[MPlayer-dev-eng] [PATCH] Pass down error code from muxer_lavf av_write_header

Tobias Diedrich ranma+mplayer at tdiedrich.de
Fri Jul 1 13:15:19 CEST 2011


The proper fix for the division by 0 when av_write_header failed is
to pass down the error code and not try to write chunks with the
muxer in a bad state.

This changes the cont_write_header, muxer_flush and
muxer_write_chunk prototypes to return an int (1 on success, 0 on
failure) and adjusts all the calling sites.

For mencoder I used a small wrapper that calls mencoder_exit if
muxer_write_chunk fails, alternatively we could check the success
at each call.

 TOOLS/vivodump.c            |    5 ++++-
 help/help_mp-de.h           |    2 +-
 help/help_mp-en.h           |    2 +-
 help/help_mp-ja.h           |    4 ++++
 libmpcodecs/ve_lavc.c       |    6 +++++-
 libmpcodecs/ve_libdv.c      |    3 +--
 libmpcodecs/ve_nuv.c        |    6 +++---
 libmpcodecs/ve_qtvideo.c    |    6 +++++-
 libmpcodecs/ve_raw.c        |    3 +--
 libmpcodecs/ve_vfw.c        |    3 +--
 libmpcodecs/ve_x264.c       |    3 ++-
 libmpcodecs/ve_xvid4.c      |   13 ++++++-------
 libmpdemux/muxer.c          |   29 ++++++++++++++++++++---------
 libmpdemux/muxer.h          |    6 +++---
 libmpdemux/muxer_avi.c      |    4 +++-
 libmpdemux/muxer_lavf.c     |    6 ++++--
 libmpdemux/muxer_mpeg.c     |    4 ++--
 libmpdemux/muxer_rawaudio.c |    4 ++--
 libmpdemux/muxer_rawvideo.c |    4 ++--
 mencoder.c                  |   18 +++++++++++++-----
 20 files changed, 83 insertions(+), 48 deletions(-)

-- 
Tobias						PGP: http://8ef7ddba.uguu.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: muxer_check_errorcode.patch
Type: text/x-diff
Size: 19304 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20110701/8b02b3f9/attachment.bin>


More information about the MPlayer-dev-eng mailing list