From 8dae4f18bb5a6b65ed01e6cf3e1558e70b480e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Mon, 1 Jan 2024 21:50:44 +0100 Subject: [PATCH] ci --- .github/workflows/build.yml | 2 +- ci/build-freebsd.sh | 1 + sub/ass_mp.c | 26 +++++++++++++---- sub/osd.c | 56 ++++++++++++++++++++----------------- 4 files changed, 53 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ddbfd90b776db..b800f542bd393 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -217,7 +217,7 @@ jobs: vulkan-headers \ wayland-protocols ./ci/build-freebsd.sh - meson test -C build + meson test -v -C build msys2: runs-on: windows-latest diff --git a/ci/build-freebsd.sh b/ci/build-freebsd.sh index c393fb25fee32..5168b67c183d3 100755 --- a/ci/build-freebsd.sh +++ b/ci/build-freebsd.sh @@ -10,6 +10,7 @@ export LDFLAGS="$LDFLAGS -L/usr/local/lib" meson setup build \ --werror \ -Dc_args="-Wno-error=deprecated -Wno-error=deprecated-declarations" \ + -Db_sanitize=address \ -Diconv=disabled \ -Dlibmpv=true \ -Dlua=enabled \ diff --git a/sub/ass_mp.c b/sub/ass_mp.c index 634681f2ec68c..fcd78ec352ac4 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -40,6 +40,8 @@ #include "video/out/bitmap_packer.h" #include "video/mp_image.h" +#include + // res_y should be track->PlayResY // It determines scaling of font sizes and more. void mp_ass_set_style(ASS_Style *style, double res_y, @@ -55,6 +57,9 @@ void mp_ass_set_style(ASS_Style *style, double res_y, } } + printf("1\n"); + fflush(stdout); + // libass_font_size = FontSize * (window_height / res_y) // scale translates parameters from PlayResY=720 to res_y double scale = res_y / 720.0; @@ -63,6 +68,9 @@ void mp_ass_set_style(ASS_Style *style, double res_y, style->PrimaryColour = MP_ASS_COLOR(opts->color); style->SecondaryColour = style->PrimaryColour; style->OutlineColour = MP_ASS_COLOR(opts->border_color); + printf("2\n"); + fflush(stdout); + if (opts->back_color.a) { style->BackColour = MP_ASS_COLOR(opts->back_color); style->BorderStyle = 4; // opaque box @@ -70,18 +78,26 @@ void mp_ass_set_style(ASS_Style *style, double res_y, style->BackColour = MP_ASS_COLOR(opts->shadow_color); style->BorderStyle = 1; // outline } - style->Outline = opts->border_size * scale; - style->Shadow = opts->shadow_offset * scale; - style->Spacing = opts->spacing * scale; - style->MarginL = opts->margin_x * scale; + + printf("3\n"); + fflush(stdout); + + style->Outline = opts->border_size ; + style->Shadow = opts->shadow_offset ; + style->Spacing = opts->spacing ; + style->MarginL = opts->margin_x ; style->MarginR = style->MarginL; - style->MarginV = opts->margin_y * scale; + style->MarginV = opts->margin_y ; + printf("4\n"); + fflush(stdout); style->ScaleX = 1.; style->ScaleY = 1.; style->Alignment = 1 + (opts->align_x + 1) + (opts->align_y + 2) % 3 * 4; #ifdef ASS_JUSTIFY_LEFT style->Justify = opts->justify; #endif + printf("5\n"); + fflush(stdout); style->Blur = opts->blur; style->Bold = opts->bold; style->Italic = opts->italic; diff --git a/sub/osd.c b/sub/osd.c index 9d6926dcb69b6..190b1fcff804c 100644 --- a/sub/osd.c +++ b/sub/osd.c @@ -72,41 +72,45 @@ static const m_option_t style_opts[] = { {0} }; +static const struct osd_style_opts aaaaaaaaaaaaaaaa = { + .font = "sans-serif", + .font_size = 55, + .color = {255, 255, 255, 255}, + .border_color = {0, 0, 0, 255}, + .shadow_color = {240, 240, 240, 128}, + .border_size = 3, + .shadow_offset = 0, + .margin_x = 25, + .margin_y = 22, + .align_x = -1, + .align_y = -1, +}; + const struct m_sub_options osd_style_conf = { .opts = style_opts, .size = sizeof(struct osd_style_opts), - .defaults = &(const struct osd_style_opts){ - .font = "sans-serif", - .font_size = 55, - .color = {255, 255, 255, 255}, - .border_color = {0, 0, 0, 255}, - .shadow_color = {240, 240, 240, 128}, - .border_size = 3, - .shadow_offset = 0, - .margin_x = 25, - .margin_y = 22, - .align_x = -1, - .align_y = -1, - }, + .defaults = &aaaaaaaaaaaaaaaa, .change_flags = UPDATE_OSD, }; +static const struct osd_style_opts ddddddddd = { + .font = "sans-serif", + .font_size = 55, + .color = {255, 255, 255, 255}, + .border_color = {0, 0, 0, 255}, + .shadow_color = {240, 240, 240, 128}, + .border_size = 3, + .shadow_offset = 0, + .margin_x = 25, + .margin_y = 22, + .align_x = 0, + .align_y = 1, +}; + const struct m_sub_options sub_style_conf = { .opts = style_opts, .size = sizeof(struct osd_style_opts), - .defaults = &(const struct osd_style_opts){ - .font = "sans-serif", - .font_size = 55, - .color = {255, 255, 255, 255}, - .border_color = {0, 0, 0, 255}, - .shadow_color = {240, 240, 240, 128}, - .border_size = 3, - .shadow_offset = 0, - .margin_x = 25, - .margin_y = 22, - .align_x = 0, - .align_y = 1, - }, + .defaults = &ddddddddd, .change_flags = UPDATE_OSD, };