[FFmpeg-devel] [PATCH] Do not leave positive values undefined when negative are defined as error

Paul B Mahol onemda at gmail.com
Wed Oct 2 18:44:06 CEST 2013


On 9/16/13, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, Sep 15, 2013 at 10:40:16PM +0000, Paul B Mahol wrote:
>> On 9/15/13, Michael Niedermayer <michaelni at gmx.at> wrote:
>> > Define positive return values as non errors and leave further meaning
>> > undefined
>> > This allows future extensions to use these values
>> >
>> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
>> > ---
>> >  cmdutils.h                  |    2 +-
>> >  libavcodec/iff.c            |    2 +-
>> >  libavcodec/wmaprodec.c      |    2 +-
>> >  libavfilter/avcodec.h       |    6 +++---
>> >  libavfilter/avfilter.h      |    2 +-
>> >  libavfilter/avfiltergraph.c |    4 ++--
>> >  libavfilter/graphparser.c   |    4 ++--
>> >  libavfilter/internal.h      |   10 +++++-----
>> >  libavfilter/lavfutils.h     |    2 +-
>> >  libavformat/avio.h          |    4 ++--
>> >  libavformat/avio_internal.h |    4 ++--
>> >  libavformat/url.h           |    4 ++--
>> >  libavutil/eval.h            |    4 ++--
>> >  libavutil/parseutils.h      |    2 +-
>> >  14 files changed, 26 insertions(+), 26 deletions(-)
>> >
>> > diff --git a/cmdutils.h b/cmdutils.h
>> > index 3af4476..a0707bd 100644
>> > --- a/cmdutils.h
>> > +++ b/cmdutils.h
>> > @@ -498,7 +498,7 @@ int read_yesno(void);
>> >   * @param filename file to read from
>> >   * @param bufptr location where pointer to buffer is returned
>> >   * @param size   location where size of buffer is returned
>> > - * @return 0 in case of success, a negative value corresponding to an
>> > + * @return >=0 in case of success, a negative value corresponding to
>> > an
>>
>> space after '='.
>>
>> >   * AVERROR error code in case of failure.
>> >   */
>> >  int cmdutils_read_file(const char *filename, char **bufptr, size_t
>> > *size);
>> > diff --git a/libavcodec/iff.c b/libavcodec/iff.c
>> > index ab2f172..9c894ef 100644
>> > --- a/libavcodec/iff.c
>> > +++ b/libavcodec/iff.c
>> > @@ -184,7 +184,7 @@ static int cmap_read_palette(AVCodecContext *avctx,
>> > uint32_t *pal)
>> >   *
>> >   * @param avctx the AVCodecContext where to extract extra context to
>> >   * @param avpkt the AVPacket to extract extra context from or NULL to
>> > use
>> > avctx
>> > - * @return 0 in case of success, a negative error code otherwise
>> > + * @return >=0 in case of success, a negative error code otherwise
>>
>> ditto
>>
>> >   */
>> >  static int extract_header(AVCodecContext *const avctx,
>> >                            const AVPacket *const avpkt) {
>> > diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
>> > index 4bd2d36..6014fe1 100644
>> > --- a/libavcodec/wmaprodec.c
>> > +++ b/libavcodec/wmaprodec.c
>> > @@ -678,7 +678,7 @@ static void
>> > decode_decorrelation_matrix(WMAProDecodeCtx
>> > *s,
>> >  /**
>> >   *@brief Decode channel transformation parameters
>> >   *@param s codec context
>> > - *@return 0 in case of success, < 0 in case of bitstream errors
>> > + *@return >=0 in case of success, < 0 in case of bitstream errors
>>
>> ditto for this and rest
>
> fixed locally

I guess it does not need major bump so it can be applied?


More information about the ffmpeg-devel mailing list