matroska: Port to LibMain

This commit is contained in:
Brian Gianforcaro 2022-03-20 13:17:58 -07:00 committed by Andreas Kling
parent b6e767f953
commit dba23c55dd
2 changed files with 6 additions and 4 deletions

View file

@ -137,7 +137,7 @@ target_link_libraries(lspci LibPCIDB LibMain)
target_link_libraries(lsusb LibUSBDB LibMain)
target_link_libraries(man LibMarkdown LibMain)
target_link_libraries(markdown-check LibMarkdown)
target_link_libraries(matroska LibVideo)
target_link_libraries(matroska LibMain LibVideo)
target_link_libraries(md LibMarkdown LibMain)
target_link_libraries(mkdir LibMain)
target_link_libraries(mkfifo LibMain)

View file

@ -4,14 +4,14 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibMain/Main.h>
#include <LibVideo/MatroskaReader.h>
int main(int, char**)
ErrorOr<int> serenity_main(Main::Arguments)
{
auto document = Video::MatroskaReader::parse_matroska_from_file("/home/anon/Videos/test-webm.webm");
if (!document) {
outln("Failed to parse :(");
return 1;
return Error::from_string_literal("Failed to parse :("sv);
}
outln("DocType is {}", document->header().doc_type.characters());
@ -51,4 +51,6 @@ int main(int, char**)
outln("\t\tBlock has lacing {}", static_cast<u8>(block.lacing()));
}
}
return 0;
}