X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Finput_manager.cpp;h=a1a58592f52c71fcec48e7d327974fc518075656;hb=38dbd37adf32cf04e1caf17ceb7888a4a5ec2f40;hp=c8c18eb8b1a41ed6b94b383f85717231cc0534d0;hpb=a9d17dba883714d98580639980f3142317a22e69;p=vlc diff --git a/modules/gui/qt4/input_manager.cpp b/modules/gui/qt4/input_manager.cpp index c8c18eb8b1..a1a58592f5 100644 --- a/modules/gui/qt4/input_manager.cpp +++ b/modules/gui/qt4/input_manager.cpp @@ -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 );