--- doc/APIchanges | 4 ++++ libavformat/avformat.h | 15 +++++++++++++++ libavformat/utils.c | 8 +++++++- libavformat/version.h | 2 +- 4 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/doc/APIchanges b/doc/APIchanges index b314a58..9179523 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,10 @@ libavutil: 2013-12-xx API changes, most recent first: +2014-02-xx - xxxxxxx - lavf 55.13.0 - avformat.h + Add AVStream.side_data and AVStream.nb_side_data for exporting stream-global + side data (e.g. replaygain tags, video rotation) + 2014-02-xx - xxxxxxx - lavc 55.35.0 - avcodec.h Give the name AVPacketSideData to the previously anonymous struct used for AVPacket.side_data. diff --git a/libavformat/avformat.h b/libavformat/avformat.h index ec9c262..3773611 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -755,6 +755,21 @@ typedef struct AVStream { */ AVPacket attached_pic; + /** + * An array of side data that applies to the whole stream (i.e. the + * container does not allow it to change between packets). + * + * - decoding: Set by libavformat when the stream is created. + * - encoding: May be set by the caller before avformat_find_stream_info(). + * + * Freed by libavformat in avformat_free_context(). + */ + AVPacketSideData *side_data; + /** + * The number of elements in the AVStream.side_data array. + */ + int nb_side_data; + /***************************************************************** * All fields below this line are not part of the public API. They * may not be used outside of libavformat and can be changed and diff --git a/libavformat/utils.c b/libavformat/utils.c index fca588b..fd18fee 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2594,7 +2594,7 @@ int av_read_pause(AVFormatContext *s) void avformat_free_context(AVFormatContext *s) { - int i; + int i, j; AVStream *st; av_opt_free(s); @@ -2604,6 +2604,12 @@ void avformat_free_context(AVFormatContext *s) for (i = 0; i < s->nb_streams; i++) { /* free all data in a stream component */ st = s->streams[i]; + + for (j = 0; j < st->nb_side_data; j++) + av_freep(&st->side_data[j].data); + av_freep(&st->side_data); + st->nb_side_data = 0; + if (st->parser) { av_parser_close(st->parser); } diff --git a/libavformat/version.h b/libavformat/version.h index 3d1e21f..ef5a148 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,7 +30,7 @@ #include "libavutil/version.h" #define LIBAVFORMAT_VERSION_MAJOR 55 -#define LIBAVFORMAT_VERSION_MINOR 12 +#define LIBAVFORMAT_VERSION_MINOR 13 #define LIBAVFORMAT_VERSION_MICRO 0 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ -- 1.7.10.4 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel