]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/input_manager.cpp
Input access locking. Part one
[vlc] / modules / gui / qt4 / input_manager.cpp
index c8c18eb8b1a41ed6b94b383f85717231cc0534d0..a1a58592f52c71fcec48e7d327974fc518075656 100644 (file)
@@ -132,22 +132,24 @@ void InputManager::update()
 
     /* Update text */
     QString text;
-    if( !EMPTY_STR(input_item_GetNowPlaying( input_GetItem(p_input) )) )
+    char *psz_name = input_GetName( input_GetItem( p_input ) );
+    char *psz_nowplaying = input_item_GetNowPlaying( input_GetItem( p_input );
+    char *psz_artist = input_item_GetArtist( input_GetItem( p_input ) );
+    if( !EMPTY_STR( psz_nowplaying ) )
     {
-        text.sprintf( "%s - %s",
-                  input_item_GetNowPlaying( input_GetItem(p_input) ),
-                  input_GetItem(p_input)->psz_name );
+        text.sprintf( "%s - %s", psz_now_playing, psz_name );
     }
-    else if( !EMPTY_STR(input_item_GetArtist( input_GetItem(p_input) )) )
+    else if( !EMPTY_STR( psz_artist ) )
     {
-        text.sprintf( "%s - %s",
-                  input_item_GetArtist( input_GetItem(p_input) ),
-                  input_GetItem(p_input)->psz_name );
+        text.sprintf( "%s - %s", psz_artist, psz_name );
     }
     else
     {
-        text.sprintf( "%s", input_GetItem(p_input)->psz_name );
+        text.sprintf( "%s", psz_name );
     }
+    free( psz_name );
+    free( psz_nowplaying );
+    free( psz_artist );
     if( old_name != text )
     {
         emit nameChanged( text );