From 14e6d660e7c53afc079aeedfd6e293c9ec71da55 Mon Sep 17 00:00:00 2001 From: Pascal Muetschard Date: Mon, 18 Oct 2021 20:15:02 -0700 Subject: [PATCH] Respect the encoder options for the header write. Fixes an issue where the encoder options were ignored in the passthrough case, because the options were free'ed and not re-initialized. --- src/zm_videostore.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp index 1bd0724d5..6f76f3521 100644 --- a/src/zm_videostore.cpp +++ b/src/zm_videostore.cpp @@ -224,6 +224,8 @@ bool VideoStore::open() { ); video_out_codec = nullptr; } + av_dict_free(&opts); + av_dict_parse_string(&opts, Options.c_str(), "=", ",#\n", 0); } // end if video_out_codec ret = avcodec_parameters_from_context(video_out_stream->codecpar, video_out_ctx); @@ -231,7 +233,6 @@ bool VideoStore::open() { Error("Could not initialize stream parameteres"); } } // end if extradata_entry - av_dict_free(&opts); } else if (monitor->GetOptVideoWriter() == Monitor::ENCODE) { int wanted_codec = monitor->OutputCodec(); if (!wanted_codec) {