[FFmpeg-devel] [PATCH v8 12/13] avfilter/split_cc: Add split_cc filter for closed caption handling

Soft Works softworkz at hotmail.com
Wed Sep 22 05:31:52 EEST 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Andreas
> Rheinhardt
> Sent: Wednesday, 22 September 2021 04:18
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH v8 12/13] avfilter/split_cc: Add split_cc
> filter for closed caption handling
> 
> > I wasn't sure whether it is guaranteed that init doesn't get called
> > twice. Probably it is?
> >
> 
> The init functions are only called from avfilter_init_dict() and
> avfilter_init_str() (the latter actually calls the former). Both of
> these require the context to be uninitialized initially. If a user calls
> these functions with an already initialized AVFilterContext, they are
> responsible for the consequences (it's undefined behaviour, most likely
> leaks).
> (I have to admit that I don't know whether it is documented whether one
> is allowed to call these functions again after the first try failed. But
> I know that the whole codebase assumes the answer to this to be "no", so
> you may presume it, too.)
> 

Good, thanks for the explanation.


> > This is a good question, as to whether it is safe to assume that the
> > filter's lifetime doesn't end before the last frame has been processed.
> > I thought it would be?
> 
> So the frames are supposed to be never forwarded to the user? Or is the
> user supposed to stop using these frames after the filter's lifetime ended?


The subtitle_header is global and is constant across all frames.
A resulting media file has only a (= the) single "subtitle header".
(it's not like a "header for each subtitle line or event").

softworkz



More information about the ffmpeg-devel mailing list