MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / Load

Function Load

libaegisub/common/keyframe.cpp:101–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101std::vector<int> Load(agi::fs::path const& filename) {
102 auto file = io::Open(filename);
103 std::istream &is(*file);
104
105 std::string header;
106 getline(is, header);
107
108 if (header == "# keyframe format v1") return agi_keyframes(is);
109 if (header.starts_with("# XviD 2pass stat file")) return enumerated_keyframes(is, xvid);
110 if (header.starts_with("# ffmpeg 2-pass log file, using xvid codec")) return enumerated_keyframes(is, xvid);
111 if (header.starts_with("# avconv 2-pass log file, using xvid codec")) return enumerated_keyframes(is, xvid);
112 if (header.starts_with("##map version")) return enumerated_keyframes(is, divx);
113 if (header.starts_with("#options:")) return enumerated_keyframes(is, x264);
114 if (header.starts_with("# WWXD log file, using qpfile format")) return indexed_keyframes(is, wwxd);
115
116 throw UnknownKeyframeFormatError("File header does not match any known formats");
117}
118
119}

Callers 4

LoadCatalogMethod · 0.85
DoLoadKeyframesMethod · 0.85
TESTFunction · 0.85
MRUManagerMethod · 0.85

Calls 4

OpenFunction · 0.85
agi_keyframesFunction · 0.85
enumerated_keyframesFunction · 0.85
indexed_keyframesFunction · 0.85

Tested by 1

TESTFunction · 0.68