(record_driver.c) Simplifications

This commit is contained in:
twinaphex 2019-02-12 06:04:52 +01:00
parent a51acb8377
commit d70d9d35f8
3 changed files with 19 additions and 17 deletions

View File

@ -526,14 +526,10 @@ void recording_driver_set_data_ptr(void *data)
recording_data = data;
}
unsigned *recording_driver_get_width(void)
void recording_driver_get_size(unsigned *width, unsigned *height)
{
return &recording_width;
}
unsigned *recording_driver_get_height(void)
{
return &recording_height;
*width = recording_width;
*height = recording_height;
}
void recording_driver_update_streaming_url(void)

View File

@ -202,12 +202,10 @@ void recording_driver_clear_data_ptr(void);
void recording_driver_set_data_ptr(void *data);
unsigned *recording_driver_get_width(void);
unsigned *recording_driver_get_height(void);
void recording_driver_free_state(void);
void recording_driver_get_size(unsigned *width, unsigned *height);
bool recording_is_enabled(void);
bool streaming_is_enabled(void);

View File

@ -1073,13 +1073,21 @@ static void retroarch_parse_input_and_config(int argc, char *argv[])
break;
case RA_OPT_SIZE:
if (sscanf(optarg, "%ux%u",
recording_driver_get_width(),
recording_driver_get_height()) != 2)
{
RARCH_ERR("Wrong format for --size.\n");
retroarch_print_help(argv[0]);
retroarch_fail(1, "retroarch_parse_input()");
unsigned recording_width = 0;
unsigned recording_height = 0;
recording_driver_get_size(&recording_width,
&recording_height);
if (sscanf(optarg, "%ux%u",
&recording_width,
&recording_height) != 2)
{
RARCH_ERR("Wrong format for --size.\n");
retroarch_print_help(argv[0]);
retroarch_fail(1, "retroarch_parse_input()");
}
}
break;