[MPlayer-cvslog] r36657 - trunk/gui/dialog/preferences.c

ib subversion at mplayerhq.hu
Mon Jan 20 15:07:09 CET 2014


Author: ib
Date: Mon Jan 20 15:07:09 2014
New Revision: 36657

Log:
Improve the dialog for subtitle encodings with iconv.

Add only available encodings from the full list to avoid
possible confusion.

Modified:
   trunk/gui/dialog/preferences.c

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Sun Jan 19 23:24:53 2014	(r36656)
+++ trunk/gui/dialog/preferences.c	Mon Jan 20 15:07:09 2014	(r36657)
@@ -58,6 +58,10 @@
 #include "libmpcodecs/vd.h"
 #include "libmpcodecs/ad.h"
 
+#ifdef CONFIG_ICONV
+#include <iconv.h>
+#endif
+
        GtkWidget * Preferences = NULL;
 static GtkWidget * AConfig;
 static GtkWidget * VConfig;
@@ -787,7 +791,17 @@ static GtkWidget * CreatePreferences( vo
   CBSubEncoding_items=g_list_append( CBSubEncoding_items,MSGTR_PREFERENCES_None );
   {
    int i;
-   for ( i=0;lEncoding[i].name;i++ ) CBSubEncoding_items=g_list_append( CBSubEncoding_items,lEncoding[i].comment );
+   iconv_t cd;
+   for ( i=0;lEncoding[i].name;i++ )
+   {
+    cd=iconv_open( lEncoding[i].name,"UTF-8" );
+
+    if (cd != (iconv_t) -1)
+    {
+     iconv_close(cd);
+     CBSubEncoding_items=g_list_append( CBSubEncoding_items,lEncoding[i].comment );
+    }
+   }
   }
   gtk_combo_set_popdown_strings( GTK_COMBO( CBSubEncoding ),CBSubEncoding_items );
   g_list_free( CBSubEncoding_items );


More information about the MPlayer-cvslog mailing list