mirror of https://github.com/mpv-player/mpv
TOOLS/matroska.py: support outputting to file
Like the previous commit, it's better to just output it to a file for meson.
This commit is contained in:
parent
f7fab994eb
commit
94950b1b22
|
@ -459,10 +459,15 @@ if __name__ == "__main__":
|
|||
def parse_toplevel(s):
|
||||
parse_one(s, 0, None, 1 << 63)
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
outfile = sys.stdout
|
||||
else:
|
||||
outfile = open(sys.argv[2], "w")
|
||||
|
||||
if sys.argv[1] == '--generate-header':
|
||||
generate_C_header(sys.stdout)
|
||||
generate_C_header(outfile)
|
||||
elif sys.argv[1] == '--generate-definitions':
|
||||
generate_C_definitions(sys.stdout)
|
||||
generate_C_definitions(outfile)
|
||||
else:
|
||||
s = open(sys.argv[1], "rb")
|
||||
while 1:
|
||||
|
|
Loading…
Reference in New Issue