Commit aa96d433 authored by Martin Storsjö's avatar Martin Storsjö

movdec: Don't parse all fragments if ignidx is set

In nonseekable files, we already stop parsing the toplevel atoms
after finding moov and one mdat. In large seekable files (or files
that are seekable, but slowly, e.g. http), reading all the fragments
at the start can take a considerable amount of time. This allows
opting out from this behaviour.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 383a3b64
......@@ -350,8 +350,9 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (err < 0)
return err;
if (c->found_moov && c->found_mdat &&
(!pb->seekable || start_pos + a.size == avio_size(pb))) {
if (!pb->seekable)
((!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX) ||
start_pos + a.size == avio_size(pb))) {
if (!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX)
c->next_root_atom = start_pos + a.size;
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment