Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
2a3c5280
Commit
2a3c5280
authored
Sep 26, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: mp4: add new language conversion tables
parent
fd9a60b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
1 deletion
+94
-1
modules/demux/Makefile.am
modules/demux/Makefile.am
+2
-1
modules/demux/mp4/languages.h
modules/demux/mp4/languages.h
+91
-0
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+1
-0
No files found.
modules/demux/Makefile.am
View file @
2a3c5280
...
...
@@ -188,7 +188,8 @@ demux_LTLIBRARIES += $(LTLIBmkv)
EXTRA_LTLIBRARIES
+=
libmkv_plugin.la
libmp4_plugin_la_SOURCES
=
demux/mp4/mp4.c demux/mp4/mp4.h
\
demux/mp4/libmp4.c demux/mp4/libmp4.h demux/mp4/id3genres.h
demux/mp4/libmp4.c demux/mp4/libmp4.h
\
demux/mp4/id3genres.h demux/mp4/languages.h
libmp4_plugin_la_LIBADD
=
$(LIBM)
libmp4_plugin_la_LDFLAGS
=
$(AM_LDFLAGS)
if
HAVE_ZLIB
...
...
modules/demux/mp4/languages.h
0 → 100644
View file @
2a3c5280
/*****************************************************************************
* languages.h: Quicktime language codes and ISO-639-2/T conversion
*****************************************************************************
* Copyright (C) 2014 VLC authors and VideoLAN
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef _VLC_MP4_LANGUAGES_H
#define _VLC_MP4_LANGUAGES_H 1
static
bool
decodeQtLanguageCode
(
uint16_t
i_language_code
,
char
*
psz_iso
,
bool
*
b_mactables
)
{
static
const
char
*
psz_qt_to_iso639_2T_lower
=
"eng"
"fra"
"deu"
"ita"
"nld"
"swe"
"spa"
"dan"
"por"
"nor"
/* 5-9 */
"heb"
"jpn"
"ara"
"fin"
"gre"
"isl"
"mlt"
"tur"
"hrv"
"zho"
/* 15-19 */
"urd"
"hin"
"tha"
"kor"
"lit"
"pol"
"hun"
"est"
"lav"
"sme"
/* 25-29 */
"fao"
"fas"
"rus"
"zho"
"nld"
/* nld==flemish */
"gle"
"sqi"
"ron"
"ces"
"slk"
/* 35-39 */
"slv"
"yid"
"srp"
"mkd"
"bul"
"ukr"
"bel"
"uzb"
"kaz"
"aze"
/* 45-49 */
"aze"
"hye"
"kat"
"mol"
"kir"
"tgk"
"tuk"
"mon"
"mon"
"pus"
/* 55-59 */
"kur"
"kas"
"snd"
"bod"
"nep"
"san"
"mar"
"ben"
"asm"
"guj"
/* 65-69 */
"pan"
"ori"
"mal"
"kan"
"tam"
"tel"
"sin"
"mya"
"khm"
"lao"
/* 75-79 */
"vie"
"ind"
"tgl"
"msa"
"msa"
"amh"
"tir"
"orm"
"som"
"swa"
/* 85-89 */
"kin"
"run"
"nya"
"mlg"
"epo"
/* 90-94 */
;
static
const
char
*
psz_qt_to_iso639_2T_upper
=
"cym"
"eus"
"cat"
"lat"
"que"
/* 128-132 */
"grn"
"aym"
"tat"
"uig"
"dzo"
"jaw"
"sun"
"glg"
"afr"
"bre"
/* 138-142 */
"iku"
"gla"
"glv"
"gle"
"ton"
"gre"
/* 148 */
;
if
(
i_language_code
<
0x400
||
i_language_code
==
0x7FFF
)
{
const
void
*
p_data
;
*
b_mactables
=
true
;
if
(
i_language_code
<=
94
)
{
p_data
=
psz_qt_to_iso639_2T_lower
+
i_language_code
*
3
;
}
else
if
(
i_language_code
>=
128
&&
i_language_code
<=
148
)
{
i_language_code
-=
128
;
p_data
=
psz_qt_to_iso639_2T_upper
+
i_language_code
*
3
;
}
else
return
false
;
memcpy
(
psz_iso
,
p_data
,
3
);
}
else
{
*
b_mactables
=
false
;
/*
* to build code: ( ( 'f' - 0x60 ) << 10 ) | ( ('r' - 0x60) << 5 ) | ('a' - 0x60)
*/
if
(
i_language_code
==
0x55C4
)
/* "und" */
{
memset
(
psz_iso
,
0
,
3
);
return
false
;
}
for
(
unsigned
i
=
0
;
i
<
3
;
i
++
)
psz_iso
[
i
]
=
(
(
i_language_code
>>
(
(
2
-
i
)
*
5
)
)
&
0x1f
)
+
0x60
;
}
return
true
;
}
#endif
modules/demux/mp4/libmp4.c
View file @
2a3c5280
...
...
@@ -32,6 +32,7 @@
#endif
#include "libmp4.h"
#include "languages.h"
#include <math.h>
/* Some assumptions:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment