Commit d2f8ca49 authored by Lukasz Marek's avatar Lukasz Marek

ffserver_config: clean up variable initialization

Signed-off-by: 's avatarLukasz Marek <lukasz.m.luki2@gmail.com>
parent f524d2e4
...@@ -341,11 +341,11 @@ int ffserver_parse_ffconfig(const char *filename, FFServerConfig *config) ...@@ -341,11 +341,11 @@ int ffserver_parse_ffconfig(const char *filename, FFServerConfig *config)
char cmd[64]; char cmd[64];
char arg[1024], arg2[1024]; char arg[1024], arg2[1024];
const char *p; const char *p;
int val, errors, warnings, line_num; int val, errors = 0, warnings = 0, line_num = 0;
FFServerStream **last_stream, *stream, *redirect; FFServerStream **last_stream, *stream = NULL, *redirect = NULL;
FFServerStream **last_feed, *feed, *s; FFServerStream **last_feed, *feed = NULL;
AVCodecContext audio_enc, video_enc; AVCodecContext audio_enc, video_enc;
enum AVCodecID audio_id, video_id; enum AVCodecID audio_id = AV_CODEC_ID_NONE, video_id = AV_CODEC_ID_NONE;
int ret = 0; int ret = 0;
av_assert0(config); av_assert0(config);
...@@ -357,17 +357,10 @@ int ffserver_parse_ffconfig(const char *filename, FFServerConfig *config) ...@@ -357,17 +357,10 @@ int ffserver_parse_ffconfig(const char *filename, FFServerConfig *config)
return ret; return ret;
} }
errors = warnings = 0;
line_num = 0;
config->first_stream = NULL; config->first_stream = NULL;
last_stream = &config->first_stream; last_stream = &config->first_stream;
config->first_feed = NULL; config->first_feed = NULL;
last_feed = &config->first_feed; last_feed = &config->first_feed;
stream = NULL;
feed = NULL;
redirect = NULL;
audio_id = AV_CODEC_ID_NONE;
video_id = AV_CODEC_ID_NONE;
#define ERROR(...) report_config_error(filename, line_num, AV_LOG_ERROR, &errors, __VA_ARGS__) #define ERROR(...) report_config_error(filename, line_num, AV_LOG_ERROR, &errors, __VA_ARGS__)
#define WARNING(...) report_config_error(filename, line_num, AV_LOG_WARNING, &warnings, __VA_ARGS__) #define WARNING(...) report_config_error(filename, line_num, AV_LOG_WARNING, &warnings, __VA_ARGS__)
...@@ -448,6 +441,7 @@ int ffserver_parse_ffconfig(const char *filename, FFServerConfig *config) ...@@ -448,6 +441,7 @@ int ffserver_parse_ffconfig(const char *filename, FFServerConfig *config)
if (stream || feed) { if (stream || feed) {
ERROR("Already in a tag\n"); ERROR("Already in a tag\n");
} else { } else {
FFServerStream *s;
feed = av_mallocz(sizeof(FFServerStream)); feed = av_mallocz(sizeof(FFServerStream));
if (!feed) { if (!feed) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment