diff options
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/audiohandler.c | 10 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 10 |
2 files changed, 11 insertions, 9 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c index 6e080dd9a..1388cfc60 100644 --- a/gtk/src/audiohandler.c +++ b/gtk/src/audiohandler.c @@ -340,11 +340,11 @@ gchar* ghb_get_user_audio_lang(GValue *settings, gint titleindex, gint track) { GValue *audio_list, *asettings; - gchar *lang = NULL; + gchar *lang; audio_list = ghb_settings_get_value(settings, "audio_list"); if (ghb_array_len(audio_list) <= track) - return NULL; + return "und"; asettings = ghb_array_get_nth(audio_list, track); track = ghb_settings_get_int(asettings, "AudioTrack"); lang = ghb_get_source_audio_lang(titleindex, track); @@ -355,7 +355,7 @@ void ghb_set_pref_audio_settings(gint titleindex, GValue *settings) { gint track; - gchar *source_lang = NULL; + gchar *source_lang; hb_audio_config_t *aconfig; GHashTable *track_indices; gint mux; @@ -378,8 +378,10 @@ ghb_set_pref_audio_settings(gint titleindex, GValue *settings) { source_lang = ghb_get_source_audio_lang(titleindex, 0); } - if (source_lang == NULL) + else + { source_lang = ghb_settings_get_string(settings, "PreferredLanguage"); + } pref_audio = ghb_settings_get_value(settings, "AudioList"); diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 8bb36a552..692e17c33 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -2354,21 +2354,21 @@ ghb_get_source_audio_lang(gint titleindex, gint track) hb_list_t * list; hb_title_t * title; hb_audio_config_t * audio; - gchar *lang = NULL; + gchar *lang = "und"; g_debug("ghb_lookup_1st_audio_lang ()\n"); if (h_scan == NULL) - return NULL; + return lang; list = hb_get_titles( h_scan ); title = (hb_title_t*)hb_list_item( list, titleindex ); if (title == NULL) - return NULL; + return lang; if (hb_list_count( title->list_audio ) <= track) - return NULL; + return lang; audio = hb_list_audio_config_item(title->list_audio, track); if (audio == NULL) - return NULL; + return lang; lang = g_strdup(audio->lang.iso639_2); return lang; |