diff options
author | James Almer <jamrial@gmail.com> | 2017-04-22 20:06:47 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-04-22 20:06:47 -0300 |
commit | 1fd76277708cf83572ba243e98f9e848c652f83d (patch) | |
tree | a6dc1008a0d893df430a9debbdc201d8e8305954 /libavcodec/utils.c | |
parent | 5b281b476b32c35527c0eea5f42161c4acad83f9 (diff) | |
parent | 549d0bdca53af7a6e0c612ab4b03baecf3a5878f (diff) | |
download | ffmpeg-1fd76277708cf83572ba243e98f9e848c652f83d.tar.gz |
Merge commit '549d0bdca53af7a6e0c612ab4b03baecf3a5878f'
* commit '549d0bdca53af7a6e0c612ab4b03baecf3a5878f':
decode: be more explicit about storing the last packet properties
Also copy pkt->size in extract_packet_props(), as it's needed for
AVFrame.pkt_size
Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 56e58cc426..6a68971d68 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -684,6 +684,12 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code goto free_and_end; } + avctx->internal->last_pkt_props = av_packet_alloc(); + if (!avctx->internal->last_pkt_props) { + ret = AVERROR(ENOMEM); + goto free_and_end; + } + avctx->internal->skip_samples_multiplier = 1; if (codec->priv_data_size > 0) { @@ -1110,6 +1116,7 @@ FF_ENABLE_DEPRECATION_WARNINGS av_frame_free(&avctx->internal->to_free); av_frame_free(&avctx->internal->buffer_frame); av_packet_free(&avctx->internal->buffer_pkt); + av_packet_free(&avctx->internal->last_pkt_props); av_freep(&avctx->internal->pool); } av_freep(&avctx->internal); @@ -1158,6 +1165,7 @@ av_cold int avcodec_close(AVCodecContext *avctx) av_frame_free(&avctx->internal->to_free); av_frame_free(&avctx->internal->buffer_frame); av_packet_free(&avctx->internal->buffer_pkt); + av_packet_free(&avctx->internal->last_pkt_props); for (i = 0; i < FF_ARRAY_ELEMS(pool->pools); i++) av_buffer_pool_uninit(&pool->pools[i]); av_freep(&avctx->internal->pool); |