diff options
| -rw-r--r-- | src/fruits/cmv/cmv2.c | 13 | ||||
| -rw-r--r-- | src/fruits/cmv/tui.c | 4 | ||||
| -rw-r--r-- | src/fruits/cmv/tui.h | 4 | ||||
| -rw-r--r-- | src/libsink/sink.c | 1 |
4 files changed, 13 insertions, 9 deletions
diff --git a/src/fruits/cmv/cmv2.c b/src/fruits/cmv/cmv2.c index 963cf7a..d8f4fc2 100644 --- a/src/fruits/cmv/cmv2.c +++ b/src/fruits/cmv/cmv2.c @@ -2,7 +2,9 @@ #define CMV_USE_SOCKET 1 #include <al/log.h> +#if CMV_USE_SOCKET #include <aki/line_processor.h> +#endif #include "../../codec/libav/common.h" @@ -127,6 +129,7 @@ static u8 sink_callback(void *userdata, u8 op, u8 type, void *opaque) case CAMU_SINK_EXIT: #if CMV_USE_SOCKET aki_line_processor_stop(&c->pro); + aki_socket_close(&c->socket); #endif camu_sink_close(&c->sink); aki_event_loop_break(&c->loop); @@ -172,12 +175,12 @@ static bool cap_callback(void *userdata, u8 op, str *name, str *unique_id, void switch (op) { case CAP_BUFFER: return camu_sink_local_buffer(&c->sink, unique_id, (struct cch_entry *)opaque); - case CAP_SWAP: - camu_sink_local_swap(&c->sink, unique_id); - break; case CAP_SET: camu_sink_local_set(&c->sink, unique_id); break; + case CAP_SWAP: + camu_sink_local_swap(&c->sink, unique_id); + break; case CAP_UNLOAD: camu_sink_local_unload(&c->sink, unique_id); break; @@ -206,12 +209,12 @@ static void timer_callback(void *userdata, struct aki_timer *timer) struct cmv *c = (struct cmv *)userdata; struct camu_sink_entry *entry = camu_sink_get_current(&c->sink); if (entry) { - tui_draw(&c->tui, &entry->clock, &entry->runner); + tui_draw(&c->tui, &entry->runner, &entry->clock); } else { tui_draw(&c->tui, NULL, NULL); } - aki_timer_again(timer); camu_sink_return_current(&c->sink); + aki_timer_again(timer); } static s32 log_callback(void *userdata, char *s) diff --git a/src/fruits/cmv/tui.c b/src/fruits/cmv/tui.c index 675d5f4..84a1846 100644 --- a/src/fruits/cmv/tui.c +++ b/src/fruits/cmv/tui.c @@ -1,7 +1,6 @@ #include <aki/file.h> #include <al/log.h> #include <sys/ioctl.h> -#include <unistd.h> #include <termios.h> #include "tui.h" @@ -75,7 +74,7 @@ static void draw_now_playing(struct cmv_tui *tui, struct camu_clock *clock, stru fprintf(tui->out, "%s", buffer); } -void tui_draw(struct cmv_tui *tui, struct camu_clock *clock, struct bmu_local *runner) +void tui_draw(struct cmv_tui *tui, struct bmu_local *runner, struct camu_clock *clock) { aki_mutex_lock(&tui->mutex); @@ -93,6 +92,7 @@ void tui_draw(struct cmv_tui *tui, struct camu_clock *clock, struct bmu_local *r for (u32 i = 0; i < tui->log_buffer.size; i++) { al_array_pop_at(tui->log_buffer, 0, msg); fprintf(tui->out, "%s\n", msg); + al_free(msg); } //tui->prev_lines = 0; diff --git a/src/fruits/cmv/tui.h b/src/fruits/cmv/tui.h index 566a5e5..8cf58c0 100644 --- a/src/fruits/cmv/tui.h +++ b/src/fruits/cmv/tui.h @@ -1,7 +1,7 @@ #pragma once -#include "../../buffer/clock.h" #include "../../bimu/local.h" +#include "../../buffer/clock.h" struct cmv_tui { s32 fd; @@ -17,5 +17,5 @@ struct cmv_tui { bool tui_init(struct cmv_tui *tui); void tui_push_log_msg(struct cmv_tui *tui, char *msg); -void tui_draw(struct cmv_tui *tui, struct camu_clock *clock, struct bmu_local *runner); +void tui_draw(struct cmv_tui *tui, struct bmu_local *runner, struct camu_clock *clock); void tui_close(struct cmv_tui *tui); diff --git a/src/libsink/sink.c b/src/libsink/sink.c index 5ca9106..50adb40 100644 --- a/src/libsink/sink.c +++ b/src/libsink/sink.c @@ -387,6 +387,7 @@ static void client_callback(void *userdata, u8 op, struct bmu_client_stream *str camu_video_buffer_free(&entry->video.buf); #endif cch_entry_free(&entry->entry); + al_str_free(&entry->unique_id); al_free(entry); al_log_debug("sink", "Entry closed."); break; |