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

Martin Storsjö martin at martin.st
Tue Dec 7 11:14:59 EET 2021


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.

Other than that, the patch looks good to me. Thanks!

// Martin



More information about the ffmpeg-devel mailing list