]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
transcode: fix wrong usage of 'static char'
authorJaroslav Kysela <perex@perex.cz>
Sat, 2 Sep 2017 10:44:28 +0000 (12:44 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 2 Sep 2017 10:44:28 +0000 (12:44 +0200)
src/transcoding/codec/codec.c
src/transcoding/codec/profile.c
src/transcoding/codec/profile_audio_class.c
src/transcoding/codec/profile_class.c
src/transcoding/transcode/audio.c
src/transcoding/transcode/video.c

index 4bd2908c81575b4b717b0af27d78511baa255833..6102424efc15adc87b86b8553b1de271e24b156c 100644 (file)
@@ -87,7 +87,7 @@ codec_get_type_string(AVCodec *self)
 const char *
 codec_get_title(AVCodec *self)
 {
-    static char codec_title[TVH_TITLE_LEN];
+    static char __thread codec_title[TVH_TITLE_LEN];
 
     memset(codec_title, 0, sizeof(codec_title));
     if (
index 1ffc5aafd626e5a47d13099a10555064879bcfde..a6efe497ad23e7754d9eadd18d15cc9a04e2a7c4 100644 (file)
@@ -177,14 +177,12 @@ tvh_codec_profile_get_name(TVHCodecProfile *self)
 const char *
 tvh_codec_profile_get_title(TVHCodecProfile *self)
 {
-    static char profile_title[TVH_TITLE_LEN];
+    static char __thread profile_title[TVH_TITLE_LEN];
 
     memset(profile_title, 0, sizeof(profile_title));
-    if (
-        str_snprintf(profile_title, sizeof(profile_title),
+    if (str_snprintf(profile_title, sizeof(profile_title),
             (self->description && strcmp(self->description, "")) ? "%s (%s)" : "%s%s",
-            self->name, self->description ? self->description : "")
-       ) {
+            self->name, self->description ? self->description : "")) {
         return NULL;
     }
     return profile_title;
@@ -319,7 +317,7 @@ tvh_codec_profile_audio_get_channel_layouts(TVHCodecProfile *self)
 void
 tvh_codec_profile_remove(TVHCodecProfile *self, int delete)
 {
-    static char uuid[UUID_HEX_SIZE];
+    char uuid[UUID_HEX_SIZE];
 
     memset(uuid, 0, sizeof(uuid));
     idnode_save_check(&self->idnode, delete);
index e036f52751be83027ffcd4906d06dc4ddbdc4692..ee3f5bf38508d1dea7db6b1d0d3c9f31ea9c4324 100644 (file)
@@ -90,7 +90,7 @@ tvh_codec_audio_get_list_channel_layouts(TVHAudioCodec *self)
     htsmsg_t *list = NULL, *map = NULL;
     const uint64_t *channel_layouts = self->channel_layouts;
     uint64_t l = 0;
-    static char l_buf[16];
+    char l_buf[16];
     int i;
 
     if (channel_layouts && (list = htsmsg_create_list())) {
@@ -165,7 +165,7 @@ codec_profile_audio_class_language_list(void *obj, const char *lang)
 {
     htsmsg_t *list = htsmsg_create_list();
     lang_code_t *lc = (lang_code_t *)lang_codes;
-    static char lc_buf[128];
+    char lc_buf[128];
 
     while (lc->code2b) {
         htsmsg_t *map = NULL;
index 1ee6d0c5c0cf9c5fde68f6412c1b43fa65c1729a..79147b7645318865ba14986544883a328ae23374 100644 (file)
@@ -93,7 +93,7 @@ static htsmsg_t *
 codec_profile_class_save(idnode_t *idnode, char *filename, size_t fsize)
 {
     htsmsg_t *map = htsmsg_create_map();
-    static char uuid[UUID_HEX_SIZE];
+    char uuid[UUID_HEX_SIZE];
     idnode_save(idnode, map);
     if (filename)
       snprintf(filename, fsize, "codec/%s", idnode_uuid_as_str(idnode, uuid));
index 02f3f3a8fdf908542c7ae665e2b902c90b566dbf..b1977a8de3bf5bb3815396ccf7390faf12b29a3e 100644 (file)
@@ -135,8 +135,8 @@ tvh_audio_context_open_encoder(TVHContext *self, AVDictionary **opts)
 static int
 tvh_audio_context_open_filters(TVHContext *self, AVDictionary **opts)
 {
-    static char source_args[128];
-    static char filters[16];
+    char source_args[128];
+    char filters[16];
     int resample = (self->iavctx->sample_rate != self->oavctx->sample_rate);
 
     // source args
index 8679ec1c41cdf0bfb7644210f433aba9d011b3ea..11cf368c11fe3db15eaccac4796f79a3619cc446 100644 (file)
@@ -168,7 +168,7 @@ tvh_video_context_open_encoder(TVHContext *self, AVDictionary **opts)
 static int
 tvh_video_context_open_filters(TVHContext *self, AVDictionary **opts)
 {
-    static char source_args[128];
+    char source_args[128];
     char *filters = NULL;
 
     // source args