aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_demux.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-03-22 17:59:30 +0100
committerAnton Khirnov <anton@khirnov.net>2022-08-08 16:20:58 +0200
commit61d9f34c70039f739bebf6870547edd9655002ec (patch)
treecfa304f0683f8ad8c18bde58d5c58b7a361e0269 /fftools/ffmpeg_demux.c
parentde9fb9fba7f6a7002ade2fe8c306a85fbf83e97d (diff)
downloadffmpeg-61d9f34c70039f739bebf6870547edd9655002ec.tar.gz
fftools/ffmpeg_demux: do not store demux packet in the context
Its use is local to input_thread().
Diffstat (limited to 'fftools/ffmpeg_demux.c')
-rw-r--r--fftools/ffmpeg_demux.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index d7dde1028f..31b233c4f4 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -117,10 +117,16 @@ static int seek_to_start(InputFile *ifile)
static void *input_thread(void *arg)
{
InputFile *f = arg;
- AVPacket *pkt = f->pkt;
+ AVPacket *pkt;
unsigned flags = f->non_blocking ? AV_THREAD_MESSAGE_NONBLOCK : 0;
int ret = 0;
+ pkt = av_packet_alloc();
+ if (!pkt) {
+ ret = AVERROR(ENOMEM);
+ goto finish;
+ }
+
while (1) {
DemuxMsg msg = { NULL };
@@ -185,9 +191,12 @@ static void *input_thread(void *arg)
}
}
+finish:
av_assert0(ret < 0);
av_thread_message_queue_set_err_recv(f->in_thread_queue, ret);
+ av_packet_free(&pkt);
+
return NULL;
}