Skip to content

Commit

Permalink
fixed video_desc_to_string returning same desc
Browse files Browse the repository at this point in the history
The function returned description was not updated by subsequent call,
because the returned thread_local variable is initialized statically.
  • Loading branch information
MartinPulec committed Jul 24, 2023
1 parent c2c7a2d commit 41da22a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down

0 comments on commit 41da22a

Please sign in to comment.