[FFmpeg-devel] avoption: make the avoption like seekable more general

Jack Lau jacklau1222gm at gmail.com
Tue Feb 11 11:53:51 EET 2025


Hi everyone,

I’m trying to solve this issue https://trac.ffmpeg.org/ticket/11394.

This ticket shows that we need use `-seekable` and `-http_seekable` to control the range header if send.

Because these options belong to different file(hls.c and http.c)

So I try to modify the http_seekable to seekable in hls.c, but I realized the avoption parameter will be released after being used once. 

In that case, the init_input and read_header functions in avformat_open_input of demux.c used avoption successively, resulting in no seekable parameter in the second part of the http request (it has been used and released by init_input). So the second part of http request still not controled by the seekable option.

I think it’s necessary to make the avoption used be more general, it can be more friendly to users, there is no need for users to use two options for the same function. So I have two solutions here:

1. Do not release avoption immediately after use, to ensure that all avoptions have a complete life cycle in avformat_open_input, but this will cause a problem, that is, it is impossible to determine which options are used and which are not used.

2. Add new avoption type like general_avoption which has a longer life cycle than ordinary avoption, so that ordinary avoption can still retain the feature of being detected whether it is used.

Anyone feel free to give me some advice, I really want to make some contribution for this issue.

Thanks
Jack


More information about the ffmpeg-devel mailing list