diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-12-29 12:19:38 +0000 |
| commit | f7813a5324be39d13ab536c245d15dfc602a7849 (patch) | |
| tree | fad99148b88823d34a5df2f0a25881a002eb291b /ffmpeg/libavformat/rtpenc_chain.c | |
| parent | b7a5a477b8ff4d4e3028b9dfb9a9df0a41463f92 (diff) | |
basic type mechanism working
Diffstat (limited to 'ffmpeg/libavformat/rtpenc_chain.c')
| -rw-r--r-- | ffmpeg/libavformat/rtpenc_chain.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/ffmpeg/libavformat/rtpenc_chain.c b/ffmpeg/libavformat/rtpenc_chain.c index 70d68ce..dea1f70 100644 --- a/ffmpeg/libavformat/rtpenc_chain.c +++ b/ffmpeg/libavformat/rtpenc_chain.c @@ -22,7 +22,6 @@ #include "avformat.h" #include "avio_internal.h" #include "rtpenc_chain.h" -#include "avio_internal.h" #include "rtp.h" #include "libavutil/opt.h" @@ -78,16 +77,19 @@ int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s, avcodec_copy_context(rtpctx->streams[0]->codec, st->codec); if (handle) { - ffio_fdopen(&rtpctx->pb, handle); + ret = ffio_fdopen(&rtpctx->pb, handle); + if (ret < 0) + ffurl_close(handle); } else - ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size); - ret = avformat_write_header(rtpctx, &opts); + ret = ffio_open_dyn_packet_buf(&rtpctx->pb, packet_size); + if (!ret) + ret = avformat_write_header(rtpctx, &opts); av_dict_free(&opts); if (ret) { - if (handle) { + if (handle && rtpctx->pb) { avio_close(rtpctx->pb); - } else { + } else if (rtpctx->pb) { uint8_t *ptr; avio_close_dyn_buf(rtpctx->pb, &ptr); av_free(ptr); |
