diff --git a/src/module/module_sdl2.c b/src/module/module_sdl2.c index a334610ce23b09273c80483d1d56be28d4e6c81a..bb8395a862f73b01d7c069d71e30cf7b81219ef8 100644 --- a/src/module/module_sdl2.c +++ b/src/module/module_sdl2.c @@ -333,14 +333,8 @@ loop: redraw = 1; } /* Handle mpv events. */ - if (event.type == wakeup_on_mpv_events) { - for (;;) { - mpv_event *mp_event = mpv_wait_event(sdl2->mpv, 0); - if (mp_event->event_id == MPV_EVENT_NONE) - break; - printf("event: %s\n", mpv_event_name(mp_event->event_id)); - } - } + if (event.type == wakeup_on_mpv_events) + lmpv_handle(win, sdl2->mpv, db, mpd_idle_events, (int *) &sdl2->mpv_time_pos, (int *) &sdl2->mpv_duration); } if (redraw) { diff --git a/src/module/module_x11.c b/src/module/module_x11.c index 9fa1e238aa3ef14870dad8bcf64a7d3dd0c251ee..cc800fd3dc09af294166e078edc9d20ae3d46ead 100644 --- a/src/module/module_x11.c +++ b/src/module/module_x11.c @@ -352,6 +352,6 @@ module_x11_handle_events(struct lkt_win *const win, sqlite3 *db, enum mpd_idle_f return false; struct module_x11_window *xwin = win->window; return lx11_handle(xwin) && - lmpv_handle(win, xwin->mpv, db, mpd_idle_events, (int *) &xwin->mpv_time_pos, - (int *) &xwin->mpv_duration); + ! lmpv_handle(win, xwin->mpv, db, mpd_idle_events, (int *) &xwin->mpv_time_pos, + (int *) &xwin->mpv_duration); } diff --git a/src/module/mpv.c b/src/module/mpv.c index e1acfe7bed26a046794d9f098b8f45bf872d1323..196dcf46472fa289322ec5393f84b24979553809 100644 --- a/src/module/mpv.c +++ b/src/module/mpv.c @@ -204,9 +204,8 @@ int lmpv_handle(struct lkt_win *win, mpv_handle *ctx, sqlite3 *db, enum mpd_idle_flag *mpd_idle_events, int *time_pos, int *time_duration) { - int ao_volume; + int ao_volume, sta = 1; struct lkt_queue_state state; - bool sta = false; mpv_event *event = NULL; mpv_event_property *prop; @@ -269,7 +268,7 @@ loop: break; } goto loop; /* A loop without indentation. */ - sta = true; + sta = 0; end: return sta; }