summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-03-18 16:45:29 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-10-03 20:56:12 +0200
commit12a88f806f4984a6afea5939f02e1ac962731e55 (patch)
tree7e6aa044590f6a077eb53adfa8502b5311c8f892
parent0bf63099cd0c0dac27e3bd3f8fb1c873a4523e1e (diff)
avformat/img2enc: Don't use sizeof(AVPacket)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavformat/img2enc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/img2enc.c b/libavformat/img2enc.c
index 655595374d..62202de9f4 100644
--- a/libavformat/img2enc.c
+++ b/libavformat/img2enc.c
@@ -77,7 +77,7 @@ static int write_muxed_file(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
VideoMuxData *img = s->priv_data;
AVCodecParameters *par = s->streams[pkt->stream_index]->codecpar;
AVStream *st;
- AVPacket pkt2;
+ AVPacket *const pkt2 = ffformatcontext(s)->pkt;
AVFormatContext *fmt = NULL;
int ret;
@@ -94,17 +94,17 @@ static int write_muxed_file(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
fmt->pb = pb;
- ret = av_packet_ref(&pkt2, pkt);
+ ret = av_packet_ref(pkt2, pkt);
if (ret < 0)
goto out;
- pkt2.stream_index = 0;
+ pkt2->stream_index = 0;
if ((ret = avcodec_parameters_copy(st->codecpar, par)) < 0 ||
(ret = avformat_write_header(fmt, NULL)) < 0 ||
- (ret = av_interleaved_write_frame(fmt, &pkt2)) < 0 ||
+ (ret = av_interleaved_write_frame(fmt, pkt2)) < 0 ||
(ret = av_write_trailer(fmt))) {}
- av_packet_unref(&pkt2);
+ av_packet_unref(pkt2);
out:
avformat_free_context(fmt);
return ret;