Jack Waller: > On Sat, Mar 6, 2021 at 12:44 AM James Almer <jamr...@gmail.com> wrote: > >> Signed-off-by: James Almer <jamr...@gmail.com> >> --- >> fftools/ffmpeg.c | 318 +++++++++++++++++++++++-------------------- >> fftools/ffmpeg.h | 4 + >> fftools/ffmpeg_opt.c | 5 +- >> 3 files changed, 177 insertions(+), 150 deletions(-) >> >> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c >> index 2abbc0ff29..46bb014de8 100644 >> --- a/fftools/ffmpeg.c >> +++ b/fftools/ffmpeg.c >> >> @@ -610,9 +611,9 @@ static void ffmpeg_cleanup(int ret) >> >> if (ost->muxing_queue) { >> while (av_fifo_size(ost->muxing_queue)) { >> - AVPacket pkt; >> + AVPacket *pkt; >> av_fifo_generic_read(ost->muxing_queue, &pkt, >> sizeof(pkt), NULL); >> > > Should you modify av_fifo_generic_read() for its second arguments( &pkt) as > well?
No, he is switching said FIFO to using pointers to AVPackets instead of AVPackets. The code above makes pkt (which is now a pointer) point to a separately allocated AVPacket. Said pointer is now the owner of this AVPacket struct; the packet is freed immediately after its usage (which I consider wasteful). (Is this actually a real FIFO? It seems that something is put in there and then the FIFO is completely drained and never used afterwards. The cyclic nature of a FIFO is never used and using av_dynarray would be easier.) - Andreas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".