summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-10-07 15:51:11 +0200
committerAnton Khirnov <anton@khirnov.net>2015-11-09 07:50:55 +0100
commit8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8 (patch)
tree02713fb01e304fd76208ab4e5934eb72a5ef4db5 /libavformat/utils.c
parentaeda1121c91395d1f0d434bc7f227423aa2ff97d (diff)
lavf: deprecate compute_pkt_fields2
All encoders set pts and dts properly now (and have been doing that for a while), so there is no good reason to do any timestamp guessing in the muxer. The newly added AVStreamInternal will be later used for storing all the private fields currently living in AVStream.
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 734f83f1cd..bb17b4aedd 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2460,6 +2460,8 @@ static void free_stream(AVStream **pst)
if (st->attached_pic.data)
av_packet_unref(&st->attached_pic);
+ av_freep(&st->internal);
+
av_dict_free(&st->metadata);
av_freep(&st->probe_data.buf);
av_free(st->index_entries);
@@ -2551,6 +2553,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
av_free(st);
return NULL;
}
+
+ st->internal = av_mallocz(sizeof(*st->internal));
+ if (!st->internal)
+ goto fail;
+
if (s->iformat) {
/* no default bitrate if decoding */
st->codec->bit_rate = 0;
@@ -2583,6 +2590,9 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
s->streams[s->nb_streams++] = st;
return st;
+fail:
+ free_stream(&st);
+ return NULL;
}
AVProgram *av_new_program(AVFormatContext *ac, int id)