This is possible now that the next-API is gone.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
After parsing the end timestamp of a WebVTT cue block, the current code
skips everything after the start of the timestamp that is not a \t, ' '
or \n and treats what is next as the start of a WebVTT cue settings list.
Yet if there is no such list, but a single \r, this will skip a part of
the cue payload (namely everything until the first occurence of \t, ' '
or \n) and treat what has not been skipped as the beginning of the
WebVTT cue settings list that extends until the next \r or \n (or the
end).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f49667d83db_3396_WebVTT_capability_tester.vtt
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
WebVTT subtitle tracks have four kinds. Certain downstream muxers
(such as for WebM) need to know which WebVTT kind this is, in order to
specify the codec id of the output track.
A new private input option, "-kind", has been added to the WebVTT
demuxer. It accepts as a value any of "subtitles" (the default),
"captions", "descriptions", and "metadata". The kind option value is
used to assign a value to the stream disposition flag, to which four
new values have been added, corresponding the four WebVTT kinds.
Signed-off-by: Matthew Heaney <matthewjheaney@google.com>
Signed-off-by: Clément Bœsch <ubitux@gmail.com>
Currently the WebVTT demuxer parses the cues but throws away
the cue id (the optional first line of the cue) and cue
settings (the optional rendering instructions that follow
the timestamp).
However, in order to write inband text tracks (to WebM
files), the entire cue payload from the WebVTT source must
be preserved.
This commit makes no change to the data part of the output
buffer packet (where the actual cue text is stored), but
does add the cue id and settings as a side data items, if
they're present in the cue. Existing code that cares only
about the data part of the packet can continue to ignore the
side data.
There are two new packet data type flags,
AV_PKT_DATA_WEBVTT_IDENTIFIER and
AV_PKT_DATA_WEBVTT_SETTINGS.