lavf/sdp: add more thorough error handling

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().
This commit is contained in:
Anton Khirnov
2021-12-04 18:26:38 +01:00
parent b0518f9977
commit fe31708eaa
2 changed files with 121 additions and 76 deletions

View File

@@ -556,10 +556,11 @@ uint64_t ff_parse_ntp_time(uint64_t ntp_ts);
* @param ttl the time to live of the stream, 0 if not multicast
* @param fmt the AVFormatContext, which might contain options modifying
* the generated SDP
* @return 0 on success, a negative error code on failure
*/
void ff_sdp_write_media(char *buff, int size, const 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, const AVStream *st, int idx,
const char *dest_addr, const char *dest_type,
int port, int ttl, AVFormatContext *fmt);
/**
* Write a packet to another muxer than the one the user originally