summaryrefslogtreecommitdiffstats
path: root/libhb/lang.c
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-07-13 16:41:49 +0000
committerRodeo <[email protected]>2013-07-13 16:41:49 +0000
commit1126b3488c02e40bf3426e35de26c420c20a3e76 (patch)
tree3aace5d02fa8c59d25b964d3e1b31013d04430f4 /libhb/lang.c
parentc4a87e9ce22fff4a3f47cfd3d3b89278f63beb83 (diff)
MacGui: populate the SRT subtitle language list dynamically from libhb.
Adds several languages that were previously missing from the list. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5645 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/lang.c')
-rw-r--r--libhb/lang.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libhb/lang.c b/libhb/lang.c
index 2e0cc3a48..4600f1020 100644
--- a/libhb/lang.c
+++ b/libhb/lang.c
@@ -200,6 +200,8 @@ static const iso639_lang_t languages[] =
{ "Zulu", "", "zu", "zul" },
{ NULL, NULL, NULL } };
+static const int lang_count = sizeof(languages) / sizeof(languages[0]);
+
iso639_lang_t * lang_for_code( int code )
{
char code_string[2];
@@ -269,3 +271,18 @@ iso639_lang_t * lang_for_english( const char * english )
return (iso639_lang_t*) languages;
}
+const iso639_lang_t* lang_get_next(const iso639_lang_t *last)
+{
+ if (last == NULL)
+ {
+ return (const iso639_lang_t*)languages;
+ }
+ if (last < languages || // out of bounds
+ last >= languages + lang_count - 2) // last valid language
+ {
+ return NULL;
+ }
+ return ++last;
+}
+
+