Skip to content

Commit

Permalink
test: test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dudemanguy committed Jan 3, 2024
1 parent ab5b250 commit 83993ad
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
6 changes: 3 additions & 3 deletions player/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -2600,9 +2600,9 @@ static int mp_property_focused(void *ctx, struct m_property *prop,
if (!vo)
return M_PROPERTY_UNAVAILABLE;

bool focused;
if (vo_control(vo, VOCTRL_GET_FOCUSED, &focused) < 1)
return M_PROPERTY_UNAVAILABLE;
bool focused = false;
// if (vo_control(vo, VOCTRL_GET_FOCUSED, &focused) < 1)
// return M_PROPERTY_UNAVAILABLE;

return m_property_bool_ro(action, arg, focused);
}
Expand Down
21 changes: 15 additions & 6 deletions test/libmpv_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,16 @@ static void test_file_loading(char *file)
{
const char *cmd[] = {"loadfile", file, NULL};
check_api_error(mpv_command(ctx, cmd));
int loaded = 0;
int finished = 0;
while (!finished) {
mpv_event *event = mpv_wait_event(ctx, 0);
switch (event->event_id) {
case MPV_EVENT_END_FILE:
finished = 1;
break;
}
}
/*int loaded = 0;
int finished = 0;
while (!finished) {
mpv_event *event = mpv_wait_event(ctx, 0);
Expand All @@ -164,10 +173,10 @@ static void test_file_loading(char *file)
}
}
if (!finished)
fail("Unable to load test file!\n");
fail("Unable to load test file!\n");*/
}

static void test_lavfi_complex(char *file)
/*static void test_lavfi_complex(char *file)
{
const char *cmd[] = {"loadfile", file, NULL};
check_api_error(mpv_command(ctx, cmd));
Expand All @@ -194,7 +203,7 @@ static void test_lavfi_complex(char *file)
}
if (!finished)
fail("Lavfi complex failed!\n");
}
}*/

// Ensure that setting options/properties work correctly and
// have the expected values.
Expand Down Expand Up @@ -263,8 +272,8 @@ int main(int argc, char *argv[])
test_options_and_properties();
printf(fmt, "test_file_loading");
test_file_loading(argv[1]);
printf(fmt, "test_lavfi_complex");
test_lavfi_complex(argv[1]);
// printf(fmt, "test_lavfi_complex");
// test_lavfi_complex(argv[1]);

mpv_destroy(ctx);
return 0;
Expand Down

0 comments on commit 83993ad

Please sign in to comment.