]> git.sesse.net Git - vlc/commitdiff
os x: fix preferences to leave x264 preset/tune empty
authorJuho Vähä-Herttua <juhovh@iki.fi>
Mon, 31 May 2010 12:23:52 +0000 (15:23 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Mon, 31 May 2010 13:56:10 +0000 (16:56 +0300)
Signed-off-by: Ilkka Ollakka <ileoo@videolan.org>
(cherry picked from commit c521391d4c4a8bbcfed35e09705698099798efd9)

Signed-off-by: Ilkka Ollakka <ileoo@videolan.org>
modules/gui/macosx/prefs_widgets.m

index ec22b65e606cb4023db98dc9ab599ed354504143..d444d176fdb29af7604d2e01dac18f87c3ca34b4 100644 (file)
@@ -1074,9 +1074,13 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
             -2, 0, o_textfieldTooltip )
         [o_combo setAutoresizingMask:NSViewWidthSizable ];
         for( i_index = 0; i_index < p_item->i_list; i_index++ )
-            if( p_item->value.psz && p_item->ppsz_list[i_index] &&
+        {
+            if( !p_item->value.psz && !p_item->ppsz_list[i_index] )
+                [o_combo selectItemAtIndex: i_index];
+            else if( p_item->value.psz && p_item->ppsz_list[i_index] &&
                 !strcmp( p_item->value.psz, p_item->ppsz_list[i_index] ) )
                 [o_combo selectItemAtIndex: i_index];
+       }
         [self addSubview: o_combo];
     }
     return self;
@@ -1118,9 +1122,13 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
     char *psz_value = config_GetPsz( VLCIntf, p_item->psz_name );
 
     for( i_index = 0; i_index < p_item->i_list; i_index++ )
-        if( psz_value && p_item->ppsz_list[i_index] &&
+    {
+        if( !psz_value && !p_item->ppsz_list[i_index] )
+            [o_combo selectItemAtIndex: i_index];
+        else if( psz_value && p_item->ppsz_list[i_index] &&
             !strcmp( psz_value, p_item->ppsz_list[i_index] ) )
             [o_combo selectItemAtIndex: i_index];
+    }
 
     free( psz_value );
     [super resetValues];