mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-02-27 04:06:30 +00:00
refactoring
This commit is contained in:
2
Makefile
2
Makefile
@@ -58,7 +58,7 @@ regen:
|
||||
|
||||
|
||||
$(PROG): $(SOURCES:.c=.o)
|
||||
$(info -- LINKING $@)
|
||||
$(info -- LD $@)
|
||||
@ $(CC) $(SOURCES:.c=.o) -o $@ $(LDFLAGS) $(LIBS)
|
||||
$(info ===== Build complete =====)
|
||||
$(info == CC = $(CC))
|
||||
|
||||
@@ -44,12 +44,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
struct main_context_t {
|
||||
struct _main_context_t {
|
||||
struct stream_t *stream;
|
||||
struct http_server_t *server;
|
||||
};
|
||||
|
||||
static struct main_context_t *_ctx;
|
||||
static struct _main_context_t *_ctx;
|
||||
|
||||
static void _block_thread_signals(void) {
|
||||
sigset_t mask;
|
||||
@@ -123,7 +123,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
pthread_t stream_loop_tid;
|
||||
pthread_t server_loop_tid;
|
||||
struct main_context_t ctx;
|
||||
struct _main_context_t ctx;
|
||||
|
||||
ctx.stream = stream;
|
||||
ctx.server = server;
|
||||
|
||||
@@ -264,9 +264,8 @@ int parse_options(int argc, char *argv[], struct device_t *dev, struct encoder_t
|
||||
int ch;
|
||||
int short_index;
|
||||
int opt_index;
|
||||
char short_opts[1024];
|
||||
char short_opts[1024] = {0};
|
||||
|
||||
memset(short_opts, 1024, 1);
|
||||
for (short_index = 0, opt_index = 0; _LONG_OPTS[opt_index].name != NULL; ++opt_index) {
|
||||
if (isalpha(_LONG_OPTS[opt_index].val)) {
|
||||
short_opts[short_index] = _LONG_OPTS[opt_index].val;
|
||||
|
||||
Reference in New Issue
Block a user