diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-27 00:37:37 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-27 00:37:37 +0400 |
commit | 53ce9905134e042516ddd7a4476dc668c0b094c4 (patch) | |
tree | 05e80abb4ef8b78c7c93bc920b32fb34ac268cc7 /libavformat/rtpenc_chain.c | |
parent | a48b890392aa22033f182421ba9e3f3b3256461d (diff) | |
parent | 154486f9adc621e620dacd76d78c30a02cc1dcd3 (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
opt: Add av_opt_set_bin()
avconv: Display the error returned by avformat_write_header
rtpenc_chain: Return an error code instead of just a plain pointer
rtpenc_chain: Free the URLContext on failure
rtpenc: Expose the ssrc as an avoption
avprobe: display the codec profile in show_stream()
avprobe: fix function prototype
cosmetics: Fix indentation
avprobe: changelog entry
avprobe: update documentation
avprobe: provide JSON output
avprobe: output proper INI format
avprobe: improve formatting
rtmp: fix url parsing
fate: document TARGET_EXEC and its usage
Conflicts:
doc/APIchanges
doc/fate.texi
doc/ffprobe.texi
ffprobe.c
libavformat/version.h
libavutil/avutil.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtpenc_chain.c')
-rw-r--r-- | libavformat/rtpenc_chain.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c index e4edfc28e1..c0f9530ac8 100644 --- a/libavformat/rtpenc_chain.c +++ b/libavformat/rtpenc_chain.c @@ -25,27 +25,31 @@ #include "avio_internal.h" #include "libavutil/opt.h" -AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, - URLContext *handle, int packet_size) +int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s, + AVStream *st, URLContext *handle, int packet_size) { - AVFormatContext *rtpctx; + AVFormatContext *rtpctx = NULL; int ret; AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL); uint8_t *rtpflags; AVDictionary *opts = NULL; - if (!rtp_format) - return NULL; + if (!rtp_format) { + ret = AVERROR(ENOSYS); + goto fail; + } /* Allocate an AVFormatContext for each output stream */ rtpctx = avformat_alloc_context(); - if (!rtpctx) - return NULL; + if (!rtpctx) { + ret = AVERROR(ENOMEM); + goto fail; + } rtpctx->oformat = rtp_format; if (!avformat_new_stream(rtpctx, NULL)) { - av_free(rtpctx); - return NULL; + ret = AVERROR(ENOMEM); + goto fail; } /* Pass the interrupt callback on */ rtpctx->interrupt_callback = s->interrupt_callback; @@ -79,8 +83,15 @@ AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st, av_free(ptr); } avformat_free_context(rtpctx); - return NULL; + return ret; } - return rtpctx; + *out = rtpctx; + return 0; + +fail: + av_free(rtpctx); + if (handle) + ffurl_close(handle); + return ret; } |