diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-24 16:41:49 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-24 16:41:49 +0400 |
commit | 595ba3b96258538566d6f42113dd0180aaee87c4 (patch) | |
tree | d589db49525821e4a074efeb985dd8a3e6c59c3b /libavformat | |
parent | bd34e26b27e9ec83727dedd1c04c40d8a245cfa8 (diff) | |
parent | 25b32586566f285d797737863c97a1c5c9c84e2b (diff) |
Merge commit '25b32586566f285d797737863c97a1c5c9c84e2b'
* commit '25b32586566f285d797737863c97a1c5c9c84e2b':
lavf: add an AVStream field for exporting stream-global side data
Conflicts:
libavformat/utils.c
libavformat/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avformat.h | 22 | ||||
-rw-r--r-- | libavformat/utils.c | 6 | ||||
-rw-r--r-- | libavformat/version.h | 4 |
3 files changed, 30 insertions, 2 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 9130ee5f5e..f953d3d019 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -824,6 +824,28 @@ 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). + * + * There may be no overlap between the side data in this array and side data + * in the packets. I.e. a given side data is either exported by the muxer + * (demuxing) / set by the caller (muxing) in this array, then it never + * appears in the packets, or the side data is exported / sent through + * the packets (always in the first packet where the value becomes known or + * changes), then it does not appear in this array. + * + * - demuxing: Set by libavformat when the stream is created. + * - muxing: May be set by the caller before avformat_write_header(). + * + * 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 8067567d6a..a10c39799a 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3509,9 +3509,15 @@ int av_read_pause(AVFormatContext *s) } void ff_free_stream(AVFormatContext *s, AVStream *st) { + int j; av_assert0(s->nb_streams>0); av_assert0(s->streams[ s->nb_streams - 1 ] == st); + 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 e0d3fc8ba8..962f5a8ab0 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,8 +30,8 @@ #include "libavutil/version.h" #define LIBAVFORMAT_VERSION_MAJOR 55 -#define LIBAVFORMAT_VERSION_MINOR 34 -#define LIBAVFORMAT_VERSION_MICRO 101 +#define LIBAVFORMAT_VERSION_MINOR 35 +#define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ |