diff options
author | Dudemanguy <random342@airmail.cc> | 2021-10-16 23:55:03 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2021-11-14 19:13:10 +0000 |
commit | 94950b1b2275cd820f6f9d6a1df581a93bea532a (patch) | |
tree | aca433fc2d6ffa52d5a7d512032d85cf8bae239e | |
parent | f7fab994eb31bb83b7f1be9eebfaaec09f7da5ae (diff) | |
download | mpv-94950b1b2275cd820f6f9d6a1df581a93bea532a.tar.bz2 mpv-94950b1b2275cd820f6f9d6a1df581a93bea532a.tar.xz |
TOOLS/matroska.py: support outputting to file
Like the previous commit, it's better to just output it to a file for
meson.
-rwxr-xr-x | TOOLS/matroska.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/TOOLS/matroska.py b/TOOLS/matroska.py index d75c45a715..e715c229df 100755 --- a/TOOLS/matroska.py +++ b/TOOLS/matroska.py @@ -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: |