2011-02-14 07:34:39 +00:00
|
|
|
/*
|
|
|
|
* This file is part of MPlayer.
|
|
|
|
*
|
|
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <inttypes.h>
|
2011-02-23 15:57:08 +00:00
|
|
|
#include <assert.h>
|
|
|
|
#include <dirent.h>
|
2011-10-04 00:41:18 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <unistd.h>
|
2011-02-14 07:34:39 +00:00
|
|
|
#include <libavutil/common.h>
|
|
|
|
|
2012-02-03 07:05:11 +00:00
|
|
|
#include "osdep/io.h"
|
|
|
|
|
2011-02-14 07:34:39 +00:00
|
|
|
#include "talloc.h"
|
|
|
|
|
2012-11-09 00:06:43 +00:00
|
|
|
#include "core/mp_core.h"
|
|
|
|
#include "core/mp_msg.h"
|
|
|
|
#include "demux/demux.h"
|
|
|
|
#include "core/path.h"
|
|
|
|
#include "core/bstr.h"
|
|
|
|
#include "core/mp_common.h"
|
2011-08-19 02:36:27 +00:00
|
|
|
#include "stream/stream.h"
|
|
|
|
|
2011-10-04 00:41:18 +00:00
|
|
|
struct find_entry {
|
|
|
|
char *name;
|
|
|
|
int matchlen;
|
2012-02-28 22:01:13 +00:00
|
|
|
off_t size;
|
2011-10-04 00:41:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int cmp_entry(const void *pa, const void *pb)
|
|
|
|
{
|
|
|
|
const struct find_entry *a = pa, *b = pb;
|
|
|
|
// check "similar" filenames first
|
|
|
|
int matchdiff = b->matchlen - a->matchlen;
|
|
|
|
if (matchdiff)
|
|
|
|
return FFSIGN(matchdiff);
|
|
|
|
// check small files first
|
2012-02-28 22:01:13 +00:00
|
|
|
off_t sizediff = a->size - b->size;
|
2011-10-04 00:41:18 +00:00
|
|
|
if (sizediff)
|
|
|
|
return FFSIGN(sizediff);
|
|
|
|
return 0;
|
|
|
|
}
|
2011-02-23 15:57:08 +00:00
|
|
|
|
|
|
|
static char **find_files(const char *original_file, const char *suffix)
|
|
|
|
{
|
|
|
|
void *tmpmem = talloc_new(NULL);
|
|
|
|
char *basename = mp_basename(original_file);
|
|
|
|
struct bstr directory = mp_dirname(original_file);
|
|
|
|
char **results = talloc_size(NULL, 0);
|
|
|
|
char *dir_zero = bstrdup0(tmpmem, directory);
|
|
|
|
DIR *dp = opendir(dir_zero);
|
|
|
|
if (!dp) {
|
|
|
|
talloc_free(tmpmem);
|
|
|
|
return results;
|
|
|
|
}
|
2011-10-04 00:41:18 +00:00
|
|
|
struct find_entry *entries = NULL;
|
2011-02-23 15:57:08 +00:00
|
|
|
struct dirent *ep;
|
|
|
|
int num_results = 0;
|
|
|
|
while ((ep = readdir(dp))) {
|
|
|
|
int suffix_offset = strlen(ep->d_name) - strlen(suffix);
|
|
|
|
// name must end with suffix
|
|
|
|
if (suffix_offset < 0 || strcmp(ep->d_name + suffix_offset, suffix))
|
|
|
|
continue;
|
|
|
|
// don't list the original name
|
|
|
|
if (!strcmp(ep->d_name, basename))
|
|
|
|
continue;
|
|
|
|
|
2012-07-28 21:47:42 +00:00
|
|
|
char *name = mp_path_join(results, directory, bstr0(ep->d_name));
|
2011-02-23 15:57:08 +00:00
|
|
|
char *s1 = ep->d_name;
|
|
|
|
char *s2 = basename;
|
|
|
|
int matchlen = 0;
|
|
|
|
while (*s1 && *s1++ == *s2++)
|
|
|
|
matchlen++;
|
2011-10-04 00:41:18 +00:00
|
|
|
// be a bit more fuzzy about matching the filename
|
|
|
|
matchlen = (matchlen + 3) / 5;
|
|
|
|
|
|
|
|
struct stat statbuf;
|
|
|
|
if (stat(name, &statbuf) != 0)
|
|
|
|
continue;
|
2012-02-28 22:01:13 +00:00
|
|
|
off_t size = statbuf.st_size;
|
2011-10-04 00:41:18 +00:00
|
|
|
|
2012-08-19 15:58:58 +00:00
|
|
|
entries = talloc_realloc(tmpmem, entries, struct find_entry,
|
2011-10-04 00:41:18 +00:00
|
|
|
num_results + 1);
|
2012-02-28 22:01:13 +00:00
|
|
|
entries[num_results] = (struct find_entry) { name, matchlen, size };
|
2011-02-23 15:57:08 +00:00
|
|
|
num_results++;
|
|
|
|
}
|
|
|
|
closedir(dp);
|
2011-10-04 00:41:18 +00:00
|
|
|
// NOTE: maybe should make it compare pointers instead
|
2012-10-31 23:24:08 +00:00
|
|
|
if (entries)
|
|
|
|
qsort(entries, num_results, sizeof(struct find_entry), cmp_entry);
|
2011-02-23 15:57:08 +00:00
|
|
|
results = talloc_realloc(NULL, results, char *, num_results);
|
2011-10-04 00:41:18 +00:00
|
|
|
for (int i = 0; i < num_results; i++) {
|
|
|
|
results[i] = entries[i].name;
|
2011-02-23 15:57:08 +00:00
|
|
|
}
|
|
|
|
talloc_free(tmpmem);
|
|
|
|
return results;
|
|
|
|
}
|
2011-02-14 07:34:39 +00:00
|
|
|
|
2012-08-19 13:31:38 +00:00
|
|
|
static int enable_cache(struct MPContext *mpctx, struct stream **stream,
|
2013-04-14 00:49:07 +00:00
|
|
|
struct demuxer **demuxer, struct demuxer_params *params)
|
2012-08-19 13:31:38 +00:00
|
|
|
{
|
|
|
|
struct MPOpts *opts = &mpctx->opts;
|
|
|
|
|
2013-07-10 13:03:54 +00:00
|
|
|
if (opts->stream_cache_size <= 0)
|
2012-08-19 13:31:38 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
char *filename = talloc_strdup(NULL, (*demuxer)->filename);
|
|
|
|
free_demuxer(*demuxer);
|
|
|
|
free_stream(*stream);
|
|
|
|
|
2013-07-11 19:10:42 +00:00
|
|
|
*stream = stream_open(filename, &mpctx->opts);
|
2012-08-19 13:31:38 +00:00
|
|
|
if (!*stream) {
|
|
|
|
talloc_free(filename);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
cache: make the stream cache a proper stream that wraps other streams
Before this commit, the cache was franken-hacked on top of the stream
API. You had to use special functions (like cache_stream_fill_buffer()
instead of stream_fill_buffer()), which would access the stream in a
cached manner.
The whole idea about the previous design was that the cache runs in a
thread or in a forked process, while the cache awa functions made sure
the stream instance looked consistent to the user. If you used the
normal functions instead of the special ones while the cache was
running, you were out of luck.
Make it a bit more reasonable by turning the cache into a stream on its
own. This makes it behave exactly like a normal stream. The stream
callbacks call into the original (uncached) stream to do work. No
special cache functions or redirections are needed. The only different
thing about cache streams is that they are created by special functions,
instead of being part of the auto_open_streams[] array.
To make things simpler, remove the threading implementation, which was
messed into the code. The threading code could perhaps be kept, but I
don't really want to have to worry about this special case. A proper
threaded implementation will be added later.
Remove the cache enabling code from stream_radio.c. Since enabling the
cache involves replacing the old stream with a new one, the code as-is
can't be kept. It would be easily possible to enable the cache by
requesting a cache size (which is also much simpler). But nobody uses
stream_radio.c and I can't even test this thing, and the cache is
probably not really important for it either.
2013-05-24 16:49:09 +00:00
|
|
|
stream_enable_cache_percent(stream,
|
2012-08-19 13:31:38 +00:00
|
|
|
opts->stream_cache_size,
|
2013-07-10 13:03:54 +00:00
|
|
|
opts->stream_cache_def_size,
|
2012-08-19 13:31:38 +00:00
|
|
|
opts->stream_cache_min_percent,
|
|
|
|
opts->stream_cache_seek_min_percent);
|
|
|
|
|
2013-07-11 19:10:42 +00:00
|
|
|
*demuxer = demux_open(*stream, "mkv", params, &mpctx->opts);
|
2012-08-19 13:31:38 +00:00
|
|
|
if (!*demuxer) {
|
|
|
|
talloc_free(filename);
|
|
|
|
free_stream(*stream);
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
talloc_free(filename);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2013-04-14 00:49:07 +00:00
|
|
|
// segment = get Nth segment of a multi-segment file
|
|
|
|
static bool check_file_seg(struct MPContext *mpctx, struct demuxer **sources,
|
|
|
|
int num_sources, unsigned char uid_map[][16],
|
|
|
|
char *filename, int segment)
|
|
|
|
{
|
|
|
|
bool was_valid = false;
|
|
|
|
struct demuxer_params params = {
|
|
|
|
.matroska_wanted_uids = uid_map,
|
|
|
|
.matroska_wanted_segment = segment,
|
|
|
|
.matroska_was_valid = &was_valid,
|
|
|
|
};
|
2013-07-11 19:10:42 +00:00
|
|
|
struct stream *s = stream_open(filename, &mpctx->opts);
|
2013-04-14 00:49:07 +00:00
|
|
|
if (!s)
|
|
|
|
return false;
|
2013-07-11 19:10:42 +00:00
|
|
|
struct demuxer *d = demux_open(s, "mkv", ¶ms, &mpctx->opts);
|
2013-04-14 00:49:07 +00:00
|
|
|
|
|
|
|
if (!d) {
|
|
|
|
free_stream(s);
|
|
|
|
return was_valid;
|
|
|
|
}
|
2013-07-12 19:58:11 +00:00
|
|
|
if (d->type == DEMUXER_TYPE_MATROSKA) {
|
2013-04-14 00:49:07 +00:00
|
|
|
for (int i = 1; i < num_sources; i++) {
|
|
|
|
if (sources[i])
|
|
|
|
continue;
|
|
|
|
if (!memcmp(uid_map[i], d->matroska_data.segment_uid, 16)) {
|
|
|
|
mp_msg(MSGT_CPLAYER, MSGL_INFO, "Match for source %d: %s\n",
|
|
|
|
i, d->filename);
|
|
|
|
|
|
|
|
if (enable_cache(mpctx, &s, &d, ¶ms) < 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
sources[i] = d;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free_demuxer(d);
|
|
|
|
free_stream(s);
|
|
|
|
return was_valid;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void check_file(struct MPContext *mpctx, struct demuxer **sources,
|
|
|
|
int num_sources, unsigned char uid_map[][16],
|
|
|
|
char *filename, int first)
|
|
|
|
{
|
|
|
|
for (int segment = first; ; segment++) {
|
|
|
|
if (!check_file_seg(mpctx, sources, num_sources, uid_map,
|
|
|
|
filename, segment))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool missing(struct demuxer **sources, int num_sources)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < num_sources; i++) {
|
|
|
|
if (!sources[i])
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-02-14 07:34:39 +00:00
|
|
|
static int find_ordered_chapter_sources(struct MPContext *mpctx,
|
2012-08-19 15:58:58 +00:00
|
|
|
struct demuxer **sources,
|
2011-02-14 07:34:39 +00:00
|
|
|
int num_sources,
|
|
|
|
unsigned char uid_map[][16])
|
|
|
|
{
|
|
|
|
int num_filenames = 0;
|
|
|
|
char **filenames = NULL;
|
|
|
|
if (num_sources > 1) {
|
2013-04-14 00:49:07 +00:00
|
|
|
char *main_filename = mpctx->demuxer->filename;
|
2011-02-14 07:34:39 +00:00
|
|
|
mp_msg(MSGT_CPLAYER, MSGL_INFO, "This file references data from "
|
|
|
|
"other sources.\n");
|
cache: make the stream cache a proper stream that wraps other streams
Before this commit, the cache was franken-hacked on top of the stream
API. You had to use special functions (like cache_stream_fill_buffer()
instead of stream_fill_buffer()), which would access the stream in a
cached manner.
The whole idea about the previous design was that the cache runs in a
thread or in a forked process, while the cache awa functions made sure
the stream instance looked consistent to the user. If you used the
normal functions instead of the special ones while the cache was
running, you were out of luck.
Make it a bit more reasonable by turning the cache into a stream on its
own. This makes it behave exactly like a normal stream. The stream
callbacks call into the original (uncached) stream to do work. No
special cache functions or redirections are needed. The only different
thing about cache streams is that they are created by special functions,
instead of being part of the auto_open_streams[] array.
To make things simpler, remove the threading implementation, which was
messed into the code. The threading code could perhaps be kept, but I
don't really want to have to worry about this special case. A proper
threaded implementation will be added later.
Remove the cache enabling code from stream_radio.c. Since enabling the
cache involves replacing the old stream with a new one, the code as-is
can't be kept. It would be easily possible to enable the cache by
requesting a cache size (which is also much simpler). But nobody uses
stream_radio.c and I can't even test this thing, and the cache is
probably not really important for it either.
2013-05-24 16:49:09 +00:00
|
|
|
if (mpctx->demuxer->stream->uncached_type != STREAMTYPE_FILE) {
|
2011-02-14 07:34:39 +00:00
|
|
|
mp_msg(MSGT_CPLAYER, MSGL_WARN, "Playback source is not a "
|
|
|
|
"normal disk file. Will not search for related files.\n");
|
|
|
|
} else {
|
|
|
|
mp_msg(MSGT_CPLAYER, MSGL_INFO, "Will scan other files in the "
|
|
|
|
"same directory to find referenced sources.\n");
|
2013-04-14 00:49:07 +00:00
|
|
|
filenames = find_files(main_filename, ".mkv");
|
2011-02-23 15:57:08 +00:00
|
|
|
num_filenames = MP_TALLOC_ELEMS(filenames);
|
2011-02-14 07:34:39 +00:00
|
|
|
}
|
2013-04-14 00:49:07 +00:00
|
|
|
// Possibly get further segments appended to the first segment
|
|
|
|
check_file(mpctx, sources, num_sources, uid_map, main_filename, 1);
|
2011-02-14 07:34:39 +00:00
|
|
|
}
|
|
|
|
|
2013-04-14 00:49:07 +00:00
|
|
|
for (int i = 0; i < num_filenames; i++) {
|
|
|
|
if (!missing(sources, num_sources))
|
|
|
|
break;
|
2012-07-30 23:35:53 +00:00
|
|
|
mp_msg(MSGT_CPLAYER, MSGL_INFO, "Checking file %s\n", filenames[i]);
|
2013-04-14 00:49:07 +00:00
|
|
|
check_file(mpctx, sources, num_sources, uid_map, filenames[i], 0);
|
2011-02-14 07:34:39 +00:00
|
|
|
}
|
2013-04-14 00:49:07 +00:00
|
|
|
|
2011-02-14 07:34:39 +00:00
|
|
|
talloc_free(filenames);
|
2013-04-14 00:49:07 +00:00
|
|
|
if (missing(sources, num_sources)) {
|
2011-02-14 07:34:39 +00:00
|
|
|
mp_msg(MSGT_CPLAYER, MSGL_ERR, "Failed to find ordered chapter part!\n"
|
|
|
|
"There will be parts MISSING from the video!\n");
|
2013-04-14 00:49:07 +00:00
|
|
|
int j = 1;
|
|
|
|
for (int i = 1; i < num_sources; i++)
|
2012-08-19 15:58:58 +00:00
|
|
|
if (sources[i]) {
|
2011-02-14 07:34:39 +00:00
|
|
|
sources[j] = sources[i];
|
|
|
|
memcpy(uid_map[j], uid_map[i], 16);
|
|
|
|
j++;
|
|
|
|
}
|
2013-04-14 00:49:07 +00:00
|
|
|
num_sources = j;
|
2011-02-14 07:34:39 +00:00
|
|
|
}
|
2013-04-14 00:49:07 +00:00
|
|
|
return num_sources;
|
2011-02-14 07:34:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void build_ordered_chapter_timeline(struct MPContext *mpctx)
|
|
|
|
{
|
|
|
|
struct MPOpts *opts = &mpctx->opts;
|
|
|
|
|
|
|
|
if (!opts->ordered_chapters) {
|
|
|
|
mp_msg(MSGT_CPLAYER, MSGL_INFO, "File uses ordered chapters, but "
|
|
|
|
"you have disabled support for them. Ignoring.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
mp_msg(MSGT_CPLAYER, MSGL_INFO, "File uses ordered chapters, will build "
|
|
|
|
"edit timeline.\n");
|
|
|
|
|
|
|
|
struct demuxer *demuxer = mpctx->demuxer;
|
|
|
|
struct matroska_data *m = &demuxer->matroska_data;
|
|
|
|
|
|
|
|
// +1 because sources/uid_map[0] is original file even if all chapters
|
|
|
|
// actually use other sources and need separate entries
|
2012-08-19 15:58:58 +00:00
|
|
|
struct demuxer **sources = talloc_array_ptrtype(NULL, sources,
|
|
|
|
m->num_ordered_chapters+1);
|
|
|
|
sources[0] = mpctx->demuxer;
|
2011-08-04 05:38:39 +00:00
|
|
|
unsigned char (*uid_map)[16] = talloc_array_ptrtype(NULL, uid_map,
|
|
|
|
m->num_ordered_chapters + 1);
|
2011-02-14 07:34:39 +00:00
|
|
|
int num_sources = 1;
|
|
|
|
memcpy(uid_map[0], m->segment_uid, 16);
|
|
|
|
|
|
|
|
for (int i = 0; i < m->num_ordered_chapters; i++) {
|
|
|
|
struct matroska_chapter *c = m->ordered_chapters + i;
|
|
|
|
if (!c->has_segment_uid)
|
|
|
|
memcpy(c->segment_uid, m->segment_uid, 16);
|
|
|
|
|
|
|
|
for (int j = 0; j < num_sources; j++)
|
|
|
|
if (!memcmp(c->segment_uid, uid_map[j], 16))
|
|
|
|
goto found1;
|
|
|
|
memcpy(uid_map[num_sources], c->segment_uid, 16);
|
2012-08-19 15:58:58 +00:00
|
|
|
sources[num_sources] = NULL;
|
2011-02-14 07:34:39 +00:00
|
|
|
num_sources++;
|
|
|
|
found1:
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
num_sources = find_ordered_chapter_sources(mpctx, sources, num_sources,
|
|
|
|
uid_map);
|
|
|
|
|
|
|
|
|
|
|
|
// +1 for terminating chapter with start time marking end of last real one
|
|
|
|
struct timeline_part *timeline = talloc_array_ptrtype(NULL, timeline,
|
|
|
|
m->num_ordered_chapters + 1);
|
|
|
|
struct chapter *chapters = talloc_array_ptrtype(NULL, chapters,
|
|
|
|
m->num_ordered_chapters);
|
|
|
|
uint64_t starttime = 0;
|
|
|
|
uint64_t missing_time = 0;
|
|
|
|
int part_count = 0;
|
|
|
|
int num_chapters = 0;
|
|
|
|
uint64_t prev_part_offset = 0;
|
|
|
|
for (int i = 0; i < m->num_ordered_chapters; i++) {
|
|
|
|
struct matroska_chapter *c = m->ordered_chapters + i;
|
|
|
|
|
|
|
|
int j;
|
|
|
|
for (j = 0; j < num_sources; j++) {
|
|
|
|
if (!memcmp(c->segment_uid, uid_map[j], 16))
|
|
|
|
goto found2;
|
|
|
|
}
|
|
|
|
missing_time += c->end - c->start;
|
|
|
|
continue;
|
|
|
|
found2:;
|
|
|
|
/* Only add a separate part if the time or file actually changes.
|
|
|
|
* Matroska files have chapter divisions that are redundant from
|
|
|
|
* timeline point of view because the same chapter structure is used
|
|
|
|
* both to specify the timeline and for normal chapter information.
|
|
|
|
* Removing a missing inserted external chapter can also cause this.
|
|
|
|
* We allow for a configurable fudge factor because of files which
|
|
|
|
* specify chapter end times that are one frame too early;
|
|
|
|
* we don't want to try seeking over a one frame gap. */
|
|
|
|
int64_t join_diff = c->start - starttime - prev_part_offset;
|
|
|
|
if (part_count == 0
|
|
|
|
|| FFABS(join_diff) > opts->chapter_merge_threshold * 1000000
|
2012-08-19 15:58:58 +00:00
|
|
|
|| sources[j] != timeline[part_count - 1].source) {
|
|
|
|
timeline[part_count].source = sources[j];
|
2011-02-14 07:34:39 +00:00
|
|
|
timeline[part_count].start = starttime / 1e9;
|
|
|
|
timeline[part_count].source_start = c->start / 1e9;
|
|
|
|
prev_part_offset = c->start - starttime;
|
|
|
|
part_count++;
|
|
|
|
} else if (part_count > 0 && join_diff) {
|
|
|
|
/* Chapter was merged at an inexact boundary;
|
|
|
|
* adjust timestamps to match. */
|
|
|
|
mp_msg(MSGT_CPLAYER, MSGL_V, "Merging timeline part %d with "
|
2011-08-04 05:38:39 +00:00
|
|
|
"offset %g ms.\n", i, join_diff / 1e6);
|
2011-02-14 07:34:39 +00:00
|
|
|
starttime += join_diff;
|
|
|
|
}
|
|
|
|
chapters[num_chapters].start = starttime / 1e9;
|
|
|
|
chapters[num_chapters].name = talloc_strdup(chapters, c->name);
|
|
|
|
starttime += c->end - c->start;
|
|
|
|
num_chapters++;
|
|
|
|
}
|
|
|
|
timeline[part_count].start = starttime / 1e9;
|
2011-08-04 05:38:39 +00:00
|
|
|
talloc_free(uid_map);
|
2011-02-14 07:34:39 +00:00
|
|
|
|
|
|
|
if (!part_count) {
|
|
|
|
// None of the parts come from the file itself???
|
|
|
|
talloc_free(sources);
|
|
|
|
talloc_free(timeline);
|
|
|
|
talloc_free(chapters);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (missing_time)
|
|
|
|
mp_msg(MSGT_CPLAYER, MSGL_ERR, "There are %.3f seconds missing "
|
|
|
|
"from the timeline!\n", missing_time / 1e9);
|
|
|
|
mpctx->sources = sources;
|
|
|
|
mpctx->num_sources = num_sources;
|
|
|
|
mpctx->timeline = timeline;
|
|
|
|
mpctx->num_timeline_parts = part_count;
|
|
|
|
mpctx->num_chapters = num_chapters;
|
|
|
|
mpctx->chapters = chapters;
|
|
|
|
}
|