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.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user