From: Jaroslav Kysela Date: Sat, 2 Sep 2017 10:44:28 +0000 (+0200) Subject: transcode: fix wrong usage of 'static char' X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=21a85371752f2c209d3e1fa5853b25569eb8f122;p=thirdparty%2Ftvheadend.git transcode: fix wrong usage of 'static char' --- diff --git a/src/transcoding/codec/codec.c b/src/transcoding/codec/codec.c index 4bd2908c8..6102424ef 100644 --- a/src/transcoding/codec/codec.c +++ b/src/transcoding/codec/codec.c @@ -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 ( diff --git a/src/transcoding/codec/profile.c b/src/transcoding/codec/profile.c index 1ffc5aafd..a6efe497a 100644 --- a/src/transcoding/codec/profile.c +++ b/src/transcoding/codec/profile.c @@ -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); diff --git a/src/transcoding/codec/profile_audio_class.c b/src/transcoding/codec/profile_audio_class.c index e036f5275..ee3f5bf38 100644 --- a/src/transcoding/codec/profile_audio_class.c +++ b/src/transcoding/codec/profile_audio_class.c @@ -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; diff --git a/src/transcoding/codec/profile_class.c b/src/transcoding/codec/profile_class.c index 1ee6d0c5c..79147b764 100644 --- a/src/transcoding/codec/profile_class.c +++ b/src/transcoding/codec/profile_class.c @@ -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)); diff --git a/src/transcoding/transcode/audio.c b/src/transcoding/transcode/audio.c index 02f3f3a8f..b1977a8de 100644 --- a/src/transcoding/transcode/audio.c +++ b/src/transcoding/transcode/audio.c @@ -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 diff --git a/src/transcoding/transcode/video.c b/src/transcoding/transcode/video.c index 8679ec1c4..11cf368c1 100644 --- a/src/transcoding/transcode/video.c +++ b/src/transcoding/transcode/video.c @@ -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