From 8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 7 Oct 2015 15:51:11 +0200 Subject: 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. --- libavformat/utils.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libavformat/utils.c') 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) -- cgit v1.2.3