]> git.sesse.net Git - vlc/blobdiff - modules/gui/beos/InterfaceWindow.cpp
Use var_CountChoices instead of var_Change(VLC_VAR_GETCHOICES) when applicable.
[vlc] / modules / gui / beos / InterfaceWindow.cpp
index ec92a03fe7b725237f4e0e0bb4dfa8e4bb294898..79873d589765e21f995f9ac42bed5ccf72237500 100644 (file)
@@ -662,34 +662,26 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
         case NAVIGATE_NEXT:
             if( p_input )
             {
-                vlc_value_t val, val_list;
-
                 /* First try to go to next chapter */
                 if( !var_Get( p_input, "chapter", &val ) )
                 {
-                    var_Change( p_input, "chapter", VLC_VAR_GETCHOICES,
-                                &val_list, NULL );
-                    if( val_list.p_list->i_count > val.i_int )
+                    int i_chapter_count = var_CountChoices( p_input, "chapter" );
+                    if( i_chapter_count > val.i_int )
                     {
-                        var_FreeList( &val_list, NULL );
                         var_SetVoid( p_input, "next-chapter" );
                         break;
                     }
-                    var_FreeList( &val_list, NULL );
                 }
 
                 /* Try to go to next title */
                 if( !var_Get( p_input, "title", &val ) )
                 {
-                    var_Change( p_input, "title", VLC_VAR_GETCHOICES,
-                                &val_list, NULL );
-                    if( val_list.p_list->i_count > val.i_int )
+                    int i_title_count = var_CountChoices( p_input, "title" );
+                    if( i_title_count > val.i_int )
                     {
-                        var_FreeList( &val_list, NULL );
                         var_SetVoid( p_input, "next-title" );
                         break;
                     }
-                    var_FreeList( &val_list, NULL );
                 }
 
                 /* Try to go to next file */