diff options
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avio.h | 15 | ||||
-rw-r--r-- | libavformat/aviobuf.c | 7 | ||||
-rw-r--r-- | libavformat/mpegtsenc.c | 6 | ||||
-rw-r--r-- | libavformat/version.h | 2 |
4 files changed, 26 insertions, 4 deletions
diff --git a/libavformat/avio.h b/libavformat/avio.h index b16d26f044..17b341d6c7 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -395,10 +395,25 @@ int avio_open2(AVIOContext **s, const char *url, int flags, * resource. * * @return 0 on success, an AVERROR < 0 on error. + * @see avio_closep */ int avio_close(AVIOContext *s); /** + * Close the resource accessed by the AVIOContext *s, free it + * and set the pointer pointing to it to NULL. + * This function can only be used if s was opened by avio_open(). + * + * The internal buffer is automatically flushed before closing the + * resource. + * + * @return 0 on success, an AVERROR < 0 on error. + * @see avio_close + */ +int avio_closep(AVIOContext **s); + + +/** * Open a write only memory stream. * * @param s new IO context diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 282a62e2b7..dc09a071fc 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -803,6 +803,13 @@ int avio_close(AVIOContext *s) return ffurl_close(h); } +int avio_closep(AVIOContext **s) +{ + int ret = avio_close(*s); + *s = NULL; + return ret; +} + int avio_printf(AVIOContext *s, const char *fmt, ...) { va_list ap; diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 0b7a678157..1b66babea0 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -669,10 +669,10 @@ static int mpegts_write_header(AVFormatContext *s) ts->sdt_packet_count = ts->sdt_packet_period-1; if (ts->mux_rate == 1) - av_log(s, AV_LOG_INFO, "muxrate VBR, "); + av_log(s, AV_LOG_VERBOSE, "muxrate VBR, "); else - av_log(s, AV_LOG_INFO, "muxrate %d, ", ts->mux_rate); - av_log(s, AV_LOG_INFO, "pcr every %d pkts, " + av_log(s, AV_LOG_VERBOSE, "muxrate %d, ", ts->mux_rate); + av_log(s, AV_LOG_VERBOSE, "pcr every %d pkts, " "sdt every %d, pat/pmt every %d pkts\n", service->pcr_packet_period, ts->sdt_packet_period, ts->pat_packet_period); diff --git a/libavformat/version.h b/libavformat/version.h index ff11c85b31..1bac92ba3e 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,7 +30,7 @@ #include "libavutil/avutil.h" #define LIBAVFORMAT_VERSION_MAJOR 54 -#define LIBAVFORMAT_VERSION_MINOR 31 +#define LIBAVFORMAT_VERSION_MINOR 32 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |