Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHo Ming Shun <cyph1984@gmail.com>2021-09-24 12:04:37 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-12-12 18:55:06 +0300
commit6f0e8b998a91f0ad9a260b01d8ff29efdf3321d3 (patch)
treea728e0b74ea96a9bab2a49916ef6f704336fec59 /libavcodec/mmaldec.c
parentb54377b3a7cd427bc121af003f12c36a32169a74 (diff)
avcodec/mmaldec: re-use AVPacket for extra_data
extra_data and normal packets (from ff_decode_get_packet) processing do not overlap, thus we can re-use the spare AVPacket to send to ffmmal_add_packet. Furthermore, this removes allocation of AVPacket on the stack and stops using deprecated av_init_packet. Tested-by: Cameron Gutman <aicommander@gmail.com> Signed-off-by: Ho Ming Shun <cyph1984@gmail.com>
Diffstat (limited to 'libavcodec/mmaldec.c')
-rw-r--r--libavcodec/mmaldec.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index f0391dfae3..f1bcaed0ff 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -782,12 +782,10 @@ static int ffmmal_receive_frame(AVCodecContext *avctx, AVFrame *frame)
int got_frame = 0;
if (avctx->extradata_size && !ctx->extradata_sent) {
- AVPacket pkt = {0};
- av_init_packet(&pkt);
- pkt.data = avctx->extradata;
- pkt.size = avctx->extradata_size;
+ avpkt->data = avctx->extradata;
+ avpkt->size = avctx->extradata_size;
ctx->extradata_sent = 1;
- if ((ret = ffmmal_add_packet(avctx, &pkt, 1)) < 0)
+ if ((ret = ffmmal_add_packet(avctx, avpkt, 1)) < 0)
return ret;
}