You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
fftools/ffmpeg_demux: do not store demux packet in the context
Its use is local to input_thread().
This commit is contained in:
@@ -593,7 +593,6 @@ static void ffmpeg_cleanup(int ret)
|
|||||||
free_input_threads();
|
free_input_threads();
|
||||||
for (i = 0; i < nb_input_files; i++) {
|
for (i = 0; i < nb_input_files; i++) {
|
||||||
avformat_close_input(&input_files[i]->ctx);
|
avformat_close_input(&input_files[i]->ctx);
|
||||||
av_packet_free(&input_files[i]->pkt);
|
|
||||||
av_freep(&input_files[i]);
|
av_freep(&input_files[i]);
|
||||||
}
|
}
|
||||||
for (i = 0; i < nb_input_streams; i++) {
|
for (i = 0; i < nb_input_streams; i++) {
|
||||||
|
@@ -437,8 +437,6 @@ typedef struct InputFile {
|
|||||||
float readrate;
|
float readrate;
|
||||||
int accurate_seek;
|
int accurate_seek;
|
||||||
|
|
||||||
AVPacket *pkt;
|
|
||||||
|
|
||||||
AVThreadMessageQueue *in_thread_queue;
|
AVThreadMessageQueue *in_thread_queue;
|
||||||
pthread_t thread; /* thread reading from this file */
|
pthread_t thread; /* thread reading from this file */
|
||||||
int non_blocking; /* reading packets from the thread should not block */
|
int non_blocking; /* reading packets from the thread should not block */
|
||||||
|
@@ -117,10 +117,16 @@ static int seek_to_start(InputFile *ifile)
|
|||||||
static void *input_thread(void *arg)
|
static void *input_thread(void *arg)
|
||||||
{
|
{
|
||||||
InputFile *f = arg;
|
InputFile *f = arg;
|
||||||
AVPacket *pkt = f->pkt;
|
AVPacket *pkt;
|
||||||
unsigned flags = f->non_blocking ? AV_THREAD_MESSAGE_NONBLOCK : 0;
|
unsigned flags = f->non_blocking ? AV_THREAD_MESSAGE_NONBLOCK : 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
pkt = av_packet_alloc();
|
||||||
|
if (!pkt) {
|
||||||
|
ret = AVERROR(ENOMEM);
|
||||||
|
goto finish;
|
||||||
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
DemuxMsg msg = { NULL };
|
DemuxMsg msg = { NULL };
|
||||||
|
|
||||||
@@ -185,9 +191,12 @@ static void *input_thread(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
finish:
|
||||||
av_assert0(ret < 0);
|
av_assert0(ret < 0);
|
||||||
av_thread_message_queue_set_err_recv(f->in_thread_queue, ret);
|
av_thread_message_queue_set_err_recv(f->in_thread_queue, ret);
|
||||||
|
|
||||||
|
av_packet_free(&pkt);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1407,9 +1407,6 @@ static int open_input_file(OptionsContext *o, const char *filename)
|
|||||||
f->rate_emu = 0;
|
f->rate_emu = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
f->pkt = av_packet_alloc();
|
|
||||||
if (!f->pkt)
|
|
||||||
exit_program(1);
|
|
||||||
f->thread_queue_size = o->thread_queue_size;
|
f->thread_queue_size = o->thread_queue_size;
|
||||||
|
|
||||||
/* check if all codec options have been used */
|
/* check if all codec options have been used */
|
||||||
|
Reference in New Issue
Block a user