aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer2016-05-13 18:03:28 -0300
committerJames Almer2016-07-19 21:43:14 -0300
commit1582e306a47977b09fddb029b999f99eb03cd485 (patch)
tree501e8160ad475e6590b97fe6d7879b7d0538f5de
parentb3820cabad87c4df7bce82f7aacd2c5c54fd1252 (diff)
avformat/avlanguage: make av_convert_lang_to() internal
The header was never installed and the function is only used in libavformat Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/asfdec_f.c2
-rw-r--r--libavformat/asfdec_o.c2
-rw-r--r--libavformat/asfenc.c2
-rw-r--r--libavformat/avienc.c2
-rw-r--r--libavformat/avlanguage.c11
-rw-r--r--libavformat/avlanguage.h7
-rw-r--r--libavformat/matroskaenc.c2
7 files changed, 21 insertions, 7 deletions
diff --git a/libavformat/asfdec_f.c b/libavformat/asfdec_f.c
index 2c81b138f2..b973eff96e 100644
--- a/libavformat/asfdec_f.c
+++ b/libavformat/asfdec_f.c
@@ -912,7 +912,7 @@ static int asf_read_header(AVFormatContext *s)
const char *rfc1766 = asf->stream_languages[asf->streams[i].stream_language_index];
if (rfc1766 && strlen(rfc1766) > 1) {
const char primary_tag[3] = { rfc1766[0], rfc1766[1], '\0' }; // ignore country code if any
- const char *iso6392 = av_convert_lang_to(primary_tag,
+ const char *iso6392 = ff_convert_lang_to(primary_tag,
AV_LANG_ISO639_2_BIBL);
if (iso6392)
av_dict_set(&st->metadata, "language", iso6392, 0);
diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index 9eefa5afa5..56f8446b5f 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -828,7 +828,7 @@ static void set_language(AVFormatContext *s, const char *rfc1766, AVDictionary *
// language abbr should contain at least 2 chars
if (rfc1766 && strlen(rfc1766) > 1) {
const char primary_tag[3] = { rfc1766[0], rfc1766[1], '\0' }; // ignore country code if any
- const char *iso6392 = av_convert_lang_to(primary_tag,
+ const char *iso6392 = ff_convert_lang_to(primary_tag,
AV_LANG_ISO639_2_BIBL);
if (iso6392)
if (av_dict_set(met, "language", iso6392, 0) < 0)
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index 88f01e0cfc..19dee3d528 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -431,7 +431,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size,
entry = av_dict_get(s->streams[n]->metadata, "language", NULL, 0);
if (entry) {
- const char *iso6391lang = av_convert_lang_to(entry->value, AV_LANG_ISO639_1);
+ const char *iso6391lang = ff_convert_lang_to(entry->value, AV_LANG_ISO639_1);
if (iso6391lang) {
int i;
for (i = 0; i < asf->nb_languages; i++) {
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 9504a022f0..fd16fff365 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -435,7 +435,7 @@ static int avi_write_header(AVFormatContext *s)
}
if (par->codec_id == AV_CODEC_ID_XSUB
&& (t = av_dict_get(s->streams[i]->metadata, "language", NULL, 0))) {
- const char* langstr = av_convert_lang_to(t->value, AV_LANG_ISO639_1);
+ const char* langstr = ff_convert_lang_to(t->value, AV_LANG_ISO639_1);
t = NULL;
if (langstr) {
char* str = av_asprintf("Subtitle - %s-xx;02", langstr);
diff --git a/libavformat/avlanguage.c b/libavformat/avlanguage.c
index 39f2560d94..f5d2ddf304 100644
--- a/libavformat/avlanguage.c
+++ b/libavformat/avlanguage.c
@@ -733,7 +733,7 @@ static int lang_table_compare(const void *lhs, const void *rhs)
return strcmp(lhs, ((const LangEntry *)rhs)->str);
}
-const char *av_convert_lang_to(const char *lang, enum AVLangCodespace target_codespace)
+const char *ff_convert_lang_to(const char *lang, enum AVLangCodespace target_codespace)
{
int i;
const LangEntry *entry = NULL;
@@ -759,7 +759,14 @@ const char *av_convert_lang_to(const char *lang, enum AVLangCodespace target_cod
entry = lang_table + entry->next_equivalent;
if (target_codespace == AV_LANG_ISO639_2_TERM)
- return av_convert_lang_to(lang, AV_LANG_ISO639_2_BIBL);
+ return ff_convert_lang_to(lang, AV_LANG_ISO639_2_BIBL);
return NULL;
}
+
+#if LIBAVFORMAT_VERSION_MAJOR < 58
+const char *av_convert_lang_to(const char *lang, enum AVLangCodespace target_codespace)
+{
+ return ff_convert_lang_to(lang, target_codespace);
+}
+#endif
diff --git a/libavformat/avlanguage.h b/libavformat/avlanguage.h
index 84bef58ab8..1d72dcb3cb 100644
--- a/libavformat/avlanguage.h
+++ b/libavformat/avlanguage.h
@@ -21,6 +21,9 @@
#ifndef AVFORMAT_AVLANGUAGE_H
#define AVFORMAT_AVLANGUAGE_H
+#include "libavutil/attributes.h"
+#include "libavformat/version.h"
+
/**
* Known language codespaces
*/
@@ -34,6 +37,10 @@ enum AVLangCodespace {
* Convert a language code to a target codespace. The source codespace is guessed.
* @return NULL if the provided lang is null or invalid.
*/
+const char *ff_convert_lang_to(const char *lang, enum AVLangCodespace target_codespace);
+#if LIBAVFORMAT_VERSION_MAJOR < 58
+attribute_deprecated
const char *av_convert_lang_to(const char *lang, enum AVLangCodespace target_codespace);
+#endif
#endif /* AVFORMAT_AVLANGUAGE_H */
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 53353bdc51..833e77d2b5 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1261,7 +1261,7 @@ static int mkv_write_simpletag(AVIOContext *pb, AVDictionaryEntry *t)
return AVERROR(ENOMEM);
if ((p = strrchr(p, '-')) &&
- (lang = av_convert_lang_to(p + 1, AV_LANG_ISO639_2_BIBL)))
+ (lang = ff_convert_lang_to(p + 1, AV_LANG_ISO639_2_BIBL)))
*p = 0;
p = key;