[vlc-commits] qt: small revector

Rémi Denis-Courmont git at videolan.org
Sun Jun 10 12:11:33 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jun 10 11:47:51 2018 +0300| [47e3ce983c620485b3e73836ab62dd11578f3e67] | committer: Rémi Denis-Courmont

qt: small revector

(no functional change)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=47e3ce983c620485b3e73836ab62dd11578f3e67
---

 modules/gui/qt/input_manager.cpp | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/modules/gui/qt/input_manager.cpp b/modules/gui/qt/input_manager.cpp
index 529d88a8c5..247baaa2b2 100644
--- a/modules/gui/qt/input_manager.cpp
+++ b/modules/gui/qt/input_manager.cpp
@@ -867,21 +867,18 @@ void InputManager::activateTeletext( bool b_enable )
                                    &count, &list, &text ) )
     {
         if( count > 0 )
-        {
-            /* Prefer the page 100 if it is present */
-            size_t i;
-            for( i = 0; i < count; i++ )
-            {
-                /* The description is the page number as a string */
-                const char *psz_page = text[i];
-                if( psz_page && !strcmp( psz_page, "100" ) )
-                    break;
+        {   /* Prefer the page 100 if it is present */
+            int id = list.p_values[0].i_int;
+            for( size_t i = 0; i < count; i++ )
+            {   /* The description is the page number as a string */
+                if( text[i] != NULL && !strcmp( text[i], "100" ) )
+                    id = list.p_values[i].i_int;
+                free(text[i]);
             }
-            if( i >= count )
-                i = 0;
-            var_SetInteger( p_input, "spu-es", b_enable ? list.p_values[i].i_int : -1 );
+            var_SetInteger( p_input, "spu-es", b_enable ? id : -1 );
         }
-        var_FreeList( &list, &text );
+        free(text);
+        free(list.p_values);
     }
 }
 



More information about the vlc-commits mailing list