diff options
author | James Almer <jamrial@gmail.com> | 2020-08-17 12:06:55 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2020-09-15 09:53:39 -0300 |
commit | 022a12b306ab2096e6ac9fc9b149828a849d65b2 (patch) | |
tree | a2936a6d547438d3664784dc5d0c3eb12f1e6929 /libavcodec/utils.c | |
parent | 8a81820624ada4d339aeb2150ad5c2b36b12860c (diff) |
avcodec/decode: use a packet list to store packet properties
Keeping only the latest packet fed to the decoder works only for decoders that
return a frame immediately after every consumed packet. Decoders that consume
several packets before they return a frame will fill said frame with properties
taken from the last consumed packet instead of the earliest.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 4f2e1649f0..cf0a55f26d 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -50,6 +50,7 @@ #include "thread.h" #include "frame_thread_encoder.h" #include "internal.h" +#include "packet_internal.h" #include "put_bits.h" #include "raw.h" #include "bytestream.h" @@ -1149,6 +1150,8 @@ av_cold int avcodec_close(AVCodecContext *avctx) av_packet_free(&avctx->internal->compat_encode_packet); av_packet_free(&avctx->internal->buffer_pkt); av_packet_free(&avctx->internal->last_pkt_props); + avpriv_packet_list_free(&avctx->internal->pkt_props, + &avctx->internal->pkt_props_tail); av_packet_free(&avctx->internal->ds.in_pkt); av_frame_free(&avctx->internal->es.in_frame); |