From 41da22a399cdd0c69fc80d466124ad190d2b78a0 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 24 Jul 2023 15:59:14 +0200 Subject: [PATCH] fixed video_desc_to_string returning same desc The function returned description was not updated by subsequent call, because the returned thread_local variable is initialized statically. --- src/video.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/video.cpp b/src/video.cpp index 1d2834433..bca72df9d 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -237,8 +237,9 @@ video_desc::operator string() const const char *video_desc_to_string(struct video_desc d) { - thread_local string s = d; - return s.c_str(); + thread_local string desc_str; + desc_str = d; + return desc_str.c_str(); } /**