summaryrefslogtreecommitdiff
path: root/src/fruits/cmsrv
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2024-11-17 15:26:17 -0500
committerAndrew Opalach <andrew@akon.city> 2024-11-17 15:26:17 -0500
commit588b6d8bfa1b2efdebf8c424c86f6069cceafa41 (patch)
tree545308813e9ae19d3293b78c7cb39555a64c0abe /src/fruits/cmsrv
parent58d38d767442c83e31ae6dbaea7b1fc8ccb00633 (diff)
downloadcamu-588b6d8bfa1b2efdebf8c424c86f6069cceafa41.tar.gz
camu-588b6d8bfa1b2efdebf8c424c86f6069cceafa41.tar.bz2
camu-588b6d8bfa1b2efdebf8c424c86f6069cceafa41.zip
Rough subtitles implementation, improve buffers
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/fruits/cmsrv')
-rw-r--r--src/fruits/cmsrv/cmsrv.c6
-rw-r--r--src/fruits/cmsrv/ui.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/src/fruits/cmsrv/cmsrv.c b/src/fruits/cmsrv/cmsrv.c
index c6f4546..511484d 100644
--- a/src/fruits/cmsrv/cmsrv.c
+++ b/src/fruits/cmsrv/cmsrv.c
@@ -127,7 +127,9 @@ s32 wmain(s32 argc, wchar_t **argv)
al_set_print(log_callback, &s);
+#ifdef CAMU_HAVE_FFMPEG
camu_ff_set_default_log_callback();
+#endif
aki_event_loop_init(&s.loop);
@@ -162,6 +164,10 @@ s32 wmain(s32 argc, wchar_t **argv)
cmsrv_ui_close(&s.ui);
+#ifdef CAMU_HAVE_FFMPEG
+ camu_ff_free_default_log_callback();
+#endif
+
aki_common_close();
return EXIT_SUCCESS;
diff --git a/src/fruits/cmsrv/ui.c b/src/fruits/cmsrv/ui.c
index 1a52641..e10db5e 100644
--- a/src/fruits/cmsrv/ui.c
+++ b/src/fruits/cmsrv/ui.c
@@ -1,8 +1,9 @@
#include <al/lib.h>
+#include <al/log.h>
#include "ui.h"
-#define LOG_RATIO 1.3
+#define LOG_RATIO 2.1
static s32 resize_cb(struct ncplane *p)
{
@@ -99,7 +100,10 @@ static void layout_lists(struct cmsrv_ui *ui, struct ncplane *parent)
static void erase_lists(struct cmsrv_ui *ui)
{
struct ncplane *n = ui->lists.n;
- if (n) ncplane_erase(n);
+ if (n) {
+ ncplane_erase(n);
+ notcurses_render(ui->nc);
+ }
}
static void putnwstr_maxwidth_yx(struct ncplane *n, u32 y, u32 x, u32 maxwidth, wstr *w)
@@ -118,7 +122,7 @@ static void render_lists(struct cmsrv_ui *ui)
u32 max_width = ncplane_dim_x(n);
u32 max_height = ncplane_dim_y(n);
u32 current_line = 0;
- s32 entries_per_list = 10;
+ s32 entries_per_list = max_height;
struct lia_list *list;
al_array_foreach(ui->server->lists, i, list) {