Skip to content

Commit 1dc709c

Browse files
committed
compress/cineform: Add missing initializers
1 parent 86988b1 commit 1dc709c

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

src/video_compress/cineform.cpp

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,26 +83,26 @@
8383
struct state_video_compress_cineform{
8484
std::mutex mutex;
8585

86-
struct video_desc saved_desc;
87-
struct video_desc precompress_desc;
88-
struct video_desc compressed_desc;
86+
video_desc saved_desc = {};
87+
video_desc precompress_desc = {};
88+
video_desc compressed_desc = {};
8989

90-
decoder_t dec;
90+
decoder_t dec = {};
9191

92-
CFHD_EncodingQuality requested_quality;
93-
int requested_threads;
94-
int requested_pool_size;
92+
CFHD_EncodingQuality requested_quality = CFHD_ENCODING_QUALITY_DEFAULT;
93+
int requested_threads = DEFAULT_THREAD_COUNT;
94+
int requested_pool_size = DEFAULT_POOL_SIZE;
9595

96-
CFHD_EncoderPoolRef encoderPoolRef;
97-
CFHD_MetadataRef metadataRef;
96+
CFHD_EncoderPoolRef encoderPoolRef = nullptr;
97+
CFHD_MetadataRef metadataRef = nullptr;
9898

99-
uint32_t frame_seq_in;
100-
uint32_t frame_seq_out;
99+
uint32_t frame_seq_in = 0;
100+
uint32_t frame_seq_out = 0;
101101

102102
std::queue<std::unique_ptr<video_frame, decltype(&vf_free)>> frame_queue;
103103

104-
bool started;
105-
bool stop;
104+
bool started = false;
105+
bool stop = false;
106106
std::condition_variable cv;
107107

108108
#ifdef MEASUREMENT
@@ -191,11 +191,6 @@ static void * cineform_compress_init(struct module *parent, const char *opts)
191191

192192
s = new state_video_compress_cineform();
193193

194-
memset(&s->saved_desc, 0, sizeof(s->saved_desc));
195-
s->requested_quality = CFHD_ENCODING_QUALITY_DEFAULT;
196-
s->requested_threads = DEFAULT_THREAD_COUNT;
197-
s->requested_pool_size = DEFAULT_POOL_SIZE;
198-
199194
char *fmt = strdup(opts);
200195
int ret = parse_fmt(s, fmt);
201196
free(fmt);

0 commit comments

Comments
 (0)