]> git.sesse.net Git - ffmpeg/commit
avformat/matroskadec: Accept more unknown-length elements II
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 16 May 2019 22:30:18 +0000 (00:30 +0200)
committerJames Almer <jamrial@gmail.com>
Tue, 16 Jul 2019 19:18:09 +0000 (16:18 -0300)
commit71c908817ec6173afb9bfbae404c6ce824cd965c
tree6bad6b5c9ccb7abcee76f721bd19b0fd0739d5a4
parent9c6d14ab84e424bdb99a1a4b499311ecf8687ceb
avformat/matroskadec: Accept more unknown-length elements II

Up until now, one last kind of unknown-length element hasn't been
properly handled: Unknown-length elements that are supposed to be
skipped, i.e. the level 1 elements that might reside after the
clusters.

This commit changes this. To do this, ebml_parse got a mode that
essentially tries to skip everything except when parsing is needed
(namely for unknown-length elements for which parsing is necessary
as they can't be skipped). This mode is selected by using a NULL
as destination where the parsed data should be written to.
It is used to parse the level 1 elements in matroska_parse_cluster.

The syntax list used for parsing must of course include links to
the syntax of all the master elements that might need to be parsed.
In other words: Instead of matroska_clusters (which contained every
level 1 element except clusters as EBML_NONE elements designated to
be skipped) matroska_segment is needed and used; matroska_clusters has
been removed.

Furthermore, matroska_segment has been reordered so that clusters are at
the front as this is now the most common case for this list.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/matroskadec.c