obs-x264: Refactor tokenizing of options

We do a bad job of handling errors in user-supplied x264 options. I want
to improve our error handling. To make my job easier, move the code for
parsing the x264 options string into its own function. Also, add some
tests for the functionality.

Aside from a minor tweak to a log message for the opencl option, this
commit should not change behavior.
This commit is contained in:
Matthew Glazar
2020-05-16 20:35:35 -07:00
parent 07ae6b4ca9
commit 40b4e32c41
5 changed files with 217 additions and 64 deletions

View File

@@ -0,0 +1,17 @@
#pragma once
#include <stddef.h>
struct obs_x264_option {
char *name;
char *value;
};
struct obs_x264_options {
size_t count;
struct obs_x264_option *options;
char **input_words;
};
struct obs_x264_options obs_x264_parse_options(const char *options_string);
void obs_x264_free_options(struct obs_x264_options options);