diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-13 23:02:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-13 23:02:56 +0200 |
commit | f01a1281ee82c82f64f1879d99cce3807f5fcf05 (patch) | |
tree | 13b563fd6123d9f8052b54e9311bb9bc8c8f2923 /libavformat/utils.c | |
parent | 313d75cd4300316f6c8de7ef3473275f454e986a (diff) | |
parent | 019d3fccc4dcf5c8379112f697ce9eb08edee9b9 (diff) | |
download | ffmpeg-f01a1281ee82c82f64f1879d99cce3807f5fcf05.tar.gz |
Merge commit '019d3fccc4dcf5c8379112f697ce9eb08edee9b9'
* commit '019d3fccc4dcf5c8379112f697ce9eb08edee9b9':
Set protocol-level metadata in AVFormatContext any time a packet is read.
Conflicts:
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index cc52d0ebf8..13d4c6b1ee 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1286,6 +1286,7 @@ static int read_from_packet_buffer(AVPacketList **pkt_buffer, static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) { int ret = 0, i, got_packet = 0; + AVDictionary *metadata = NULL; av_init_packet(pkt); @@ -1411,6 +1412,14 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) av_packet_merge_side_data(pkt); } + av_opt_get_dict_val(s, "metadata", AV_OPT_SEARCH_CHILDREN, &metadata); + if (metadata) { + s->event_flags |= AVFMT_EVENT_FLAG_METADATA_UPDATED; + av_dict_copy(&s->metadata, metadata, 0); + av_dict_free(&metadata); + av_opt_set_dict_val(s, "metadata", NULL, AV_OPT_SEARCH_CHILDREN); + } + if (s->debug & FF_FDEBUG_TS) av_log(s, AV_LOG_DEBUG, "read_frame_internal stream=%d, pts=%s, dts=%s, " |