[FFmpeg-devel] [PATCH 2/2] lavf/concat: add max_opened_files option.

Nicolas George nicolas.george at normalesup.org
Tue Aug 6 17:33:02 CEST 2013


Le decadi 10 thermidor, an CCXXI, Michael Niedermayer a écrit :
> do you expect the open file limit to be large/huge ?

I believe a 1024 limit on the number of opened files is quite common, that
puts a reasonable upper bound, although I suspect most people who will use
this option will use a much lower value.

> also the current code seems to be O(n) already in concat_seek()

I believe it is, but I think that performances in sequential reads are more
important than performances while seeking. Also, seeking could be optimized
quite easily.

> so i wonder why you are using a double linked list instead of just
> iterating over the (open) elements and closing the oldest based on
> some use "timestamp"

It seemed more elegant at the time.

Iterating over the whole list to find the oldest opened is very easy, of
course, but the whole list is quite long.

A second table of opened files would require as much book-keeping as a LRU
linked list.

I can submit a patch for the first version, but my preference goes towards
the LRU linked list using this to avoid reinventing the wheel each time
linked lists are useful:

http://ffmpeg.org/pipermail/ffmpeg-devel/2013-July/146378.html

Comments on that patch, especially regarding the principle, would be
welcome.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130806/f04c7f7d/attachment.asc>


More information about the ffmpeg-devel mailing list