[FFmpeg-devel] [PATCH 3/3] lavf/sdp: add more thorough error handling

Anton Khirnov anton at khirnov.net
Tue Dec 7 12:22:58 EET 2021


Quoting Martin Storsjö (2021-12-07 10:14:59)
> On Sat, 4 Dec 2021, Anton Khirnov wrote:
> 
> > Return error codes when constructing a stream config fails, rather than
> > just disregarding the failure and continuing.
> > Propagate the error codes from av_sdp_create().
> > ---
> > libavformat/internal.h |   7 +-
> > libavformat/sdp.c      | 189 +++++++++++++++++++++++++----------------
> > 2 files changed, 120 insertions(+), 76 deletions(-)
> 
> > @@ -867,9 +910,9 @@ int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size)
> >     return AVERROR(ENOSYS);
> > }
> >
> > -void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx,
> > -                        const char *dest_addr, const char *dest_type,
> > -                        int port, int ttl, AVFormatContext *fmt)
> > +int ff_sdp_write_media(char *buff, int size, AVStream *st, int idx,
> > +                       const char *dest_addr, const char *dest_type,
> > +                       int port, int ttl, AVFormatContext *fmt)
> > {
> > }
> > #endif
> 
> This dummy function (which only is compiled if some things are disabled) 
> needs a "return 0" too.

Should it really be 0 rather than AVERROR(ENOSYS)?

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list