[FFmpeg-devel] [PATCH 2/3] lavf/srtdec: Permit streaming input

Tomas Härdin git at haerdin.se
Sat Mar 30 18:28:52 EET 2024


lör 2024-03-30 klockan 17:02 +0100 skrev Andreas Rheinhardt:
> > > ASS demuxer sorts its packets because
> > > there is no guarantee the text are sorted in the file
> > 
> > So? I'm making a normative argument.
> > 
> 
> Normative about what? The ASS specification [1] explicitly says:
> 
> "SSA does not care what order events are entered in.
> 
>      They could be entered in complete reverse order, and SSA would
> still play everything correctly in the right order ie. you cannot
> assume
> that each dialogue line is in chronological order in the script
> file."

This describes what SSA does, not what lavf should do. lavf does not
guarantee ordered subtitles in general, as far as I can tell.

> If you force reordering on our users, then this is a breaking change

Hence why we shouldn't put business logic in lavf. It would have been
better to put it in ffmpeg.c. Not putting business logic in lavf is a
point I've been making for years. Here we see an excellent reason why.

We can maintain the current behavior by putting the sorting logic
further up in lavf, assuming API users care. If API users don't care
but CLI users do then we could put it in ffmpeg.c.

If we are to maintain compatibility with an ill-defined set of API
users rather than say specific packages (vlc, mpv, melt etc) then the
only sensible solution is to put the sorting logic further up in lavf,
say demux.c.

/Tomas


More information about the ffmpeg-devel mailing list