[FFmpeg-devel] [PATCH v2] [RFC] lavc, lavfmt: add FLIF decoding support

Kartik K. Khullar kartikkhullar840 at gmail.com
Mon Aug 3 21:10:01 EEST 2020


Wow,
That is such an awesome idea.
Did not know about that offsetof() thing earlier. Definitely going to use
this idea.


> IIRC, the Linux kernel makes heavy use of this structure.
>

That's really cool.

Actually I implemented linked lists and not dynamic arrays because some
elements from somewhere in the middle of the list were to be removed while
processing the transform, and dynamic arrays would just not be suitable for
such
usage because then there will be empty blocks lying around in the array all
over.
So that's why I thought of going with a linked list so that I will keep
deleting nodes
from anywhere I want and no problem would arise.

I will try and implement this structure making the list doubly and then add
a
sentinel node and then process it the same way you just suggested.
It will make deletion of nodes much much simpler since I will just have to
pass the
address of the node of list which has to be deleted and offsetof()
arithmetic will help us
find the whole Object and then we will remove it.
Before I was passing position of the node to be deleted and then the list
was traversed
all over till that node and then it was deleted. Definitely was a very
inefficient way.

Thank You so much.
Kartik.


More information about the ffmpeg-devel mailing list