diff --git a/Userland/Applications/VideoPlayer/CMakeLists.txt b/Userland/Applications/VideoPlayer/CMakeLists.txt index c6f46a7babf..1fcab872c19 100644 --- a/Userland/Applications/VideoPlayer/CMakeLists.txt +++ b/Userland/Applications/VideoPlayer/CMakeLists.txt @@ -9,4 +9,4 @@ set(SOURCES ) serenity_bin(VideoPlayer) -target_link_libraries(VideoPlayer LibVideo LibAudio LibGUI) +target_link_libraries(VideoPlayer LibVideo LibAudio LibGUI LibMain) diff --git a/Userland/Applications/VideoPlayer/main.cpp b/Userland/Applications/VideoPlayer/main.cpp index 189f03ed18a..363e7cda496 100644 --- a/Userland/Applications/VideoPlayer/main.cpp +++ b/Userland/Applications/VideoPlayer/main.cpp @@ -10,13 +10,14 @@ #include #include #include +#include #include #include -int main(int argc, char** argv) +ErrorOr serenity_main(Main::Arguments arguments) { - auto app = GUI::Application::construct(argc, argv); - auto window = GUI::Window::construct(); + auto app = TRY(GUI::Application::try_create(arguments)); + auto window = TRY(GUI::Window::try_create()); auto document = Video::MatroskaReader::parse_matroska_from_file("/home/anon/Videos/test-webm.webm"); auto const& optional_track = document->track_for_track_type(Video::TrackEntry::TrackType::Video); @@ -32,7 +33,7 @@ int main(int argc, char** argv) auto& image_widget = main_widget.add(); image_widget.set_bitmap(image); image_widget.set_fixed_size(video_track.pixel_height, video_track.pixel_width); - main_widget.add_child(image_widget); + TRY(main_widget.try_add_child(image_widget)); Video::VP9::Decoder vp9_decoder; for (auto const& cluster : document->clusters()) {