# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include <vlc_interface.h>
#include <vlc_playlist.h>
#include <vlc_vout.h>
static void DirectXPopupMenu( event_thread_t *p_event, bool b_open )
{
- playlist_t *p_playlist =
- vlc_object_find( p_event, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
- if( p_playlist != NULL )
+ playlist_t *p_playlist = vlc_object_find( p_event,
+ VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ if( p_playlist )
{
vlc_value_t val;
val.b_bool = b_open;
#ifdef UNICODE
{
wchar_t *psz_title = malloc( strlen(val.psz_string) * 2 + 2 );
- mbstowcs( psz_title, val.psz_string, strlen(val.psz_string)*2);
- psz_title[strlen(val.psz_string)] = 0;
- free( val.psz_string ); val.psz_string = (char *)psz_title;
+ if( psz_title )
+ {
+ mbstowcs( psz_title, val.psz_string, strlen(val.psz_string)*2);
+ psz_title[strlen(val.psz_string)] = 0;
+ free( val.psz_string ); val.psz_string = (char *)psz_title;
+ }
}
#endif
/* the user wants to close the window */
case WM_CLOSE:
{
- playlist_t * p_playlist =
- (playlist_t *)vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- if( p_playlist == NULL )
+ playlist_t * p_playlist = vlc_object_find( p_vout,
+ VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ if( p_playlist )
{
- return 0;
+ playlist_Stop( p_playlist );
+ vlc_object_release( p_playlist );
}
-
- playlist_Stop( p_playlist );
- vlc_object_release( p_playlist );
return 0;
}