Commit Graph

18 Commits

Author SHA1 Message Date
wm4 f50b105d06 tl_matroska: fix use-after-free with --cache
If cache was enabled, using ordered chapters could easily crash. The
reason is that enable_cache() reopens the demuxer and closes the old
one. The code after that (reading m->ordered_chapters etc.) then
accessed freed data.

This commit also avoids enabling cache for files which are not used
(which would make opening much slower).
2013-10-19 22:58:02 +02:00
Ben Boeckel 1b30a0bbf9 matroska: don't add time for chapters without a source 2013-10-15 21:16:05 -04:00
Ben Boeckel 648e8fbeed matroska: log about where missing time comes from 2013-10-15 21:04:16 -04:00
Ben Boeckel 78545fee42 matroska: only error if at least a millisecond is missing 2013-10-15 20:53:10 -04:00
Ben Boeckel abee328f20 matroska: account for missing information from short sources
If a source is shorter than the requested chapter length, account for
the time missing.
2013-10-15 20:53:10 -04:00
Ben Boeckel e80fd3f9e1 matroska: modify chapter limits by join_diff
When adding or removing frames to avoid 1-frame seeks on chapter
boundaries, the end of the chapter needs to be pushed or pulled by the
same amount to keep the intended end frame the same.
2013-10-15 20:46:38 -04:00
Ben Boeckel 67eb187826 matroska: use memmove when collapsing the source list down 2013-10-08 22:00:23 -04:00
Ben Boeckel 47345219a3 matroska: avoid requesting the same source multiple times 2013-10-08 22:00:23 -04:00
Ben Boeckel f72a900892 matroska: support chapter references to ordered editions
Since ordered editions can reference external files, when an ordered
chapter references another ordered edition, we have to go and figure out
what is is referencing as well.
2013-10-08 00:51:50 -04:00
Ben Boeckel 5cd33853f2 matroska: recursively search for referenced segments
When playing a Matroska file with ordered chapters, it may reference
another file by edition uid. When this edition is also ordered, it may
reference other files. When this occurs, the new segment/edition pair is
added to the list of sources to search for.
2013-10-08 00:51:50 -04:00
Ben Boeckel d8e5ac00bb matroska: refactor ordered chapter timeline building
This will need to be recursive to support chapters referencing ordered
editions in other files.
2013-10-07 22:43:42 -04:00
Ben Boeckel 2fe2be4df3 matroska: select the edition using the requested edition uid 2013-10-07 22:42:40 -04:00
Ben Boeckel 07fbba3935 matroska: store segment/edition uids in a single structure
To support edition references in matroska chapters, editions need to be
remembered for each chapter and source. To facilitate easier management
of these now-paired uids, a single structure is used.
2013-10-07 22:40:39 -04:00
Ben Boeckel 828a952c9a matroska: fix uninitialized memory accesses with ordered chapters
There is uninitialized memory access if the actual size isn't passed
along. In the worst case, this can cause a source to be loaded against
the uninitialized memory, causing a false count of found versus required
sources, preventing the "Failed to find ordered chapter part" message.
2013-09-26 18:20:32 +02:00
wm4 1aae5981a7 core: remove a minor memory leak 2013-09-08 05:17:05 +02:00
wm4 8be9c49fcd core: add a playlist demuxer
Modeled after the old playlist_parser.c, but actually new code, and it
works a bit differently.

Demuxers (and sometimes streams) are the component that should be used
to open files and to determine the file format. This was already done
for subtitles, but playlists still use a separate code path.
2013-08-26 10:09:45 +02:00
Stefano Pigozzi 406241005e core: move contents to mpvcore (2/2)
Followup commit. Fixes all the files references.
2013-08-06 22:52:31 +02:00
Stefano Pigozzi bc27f946c2 core: move contents to mpvcore (1/2)
core is used in many unix systems for core dumps. For that reason some tools
work under the assumption that the file is indeed a core dump (for example
autoconf does this).

This commit just renames the files. The following one will change all the
includes to fix compilation. This is done this way because git has a easier
time tracing file changes if there is a pure rename commit.
2013-08-06 22:48:47 +02:00