- vlc_mutex_init( p_this, &p_sys->lock );
-
- p_sys_global = p_sys;
- p_sys->psz_submit_host = NULL;
- p_sys->psz_submit_file = NULL;
- p_sys->b_handshaked = VLC_FALSE;
- p_sys->time_next_exchange = time( NULL );
- p_sys->psz_username = NULL;
- p_sys->b_paused = VLC_FALSE;
-
-#define MALLOC_CHECK( a ) \
- if( !a ) { \
- vlc_mutex_destroy( &p_sys->lock ); \
- MEM_ERROR \
- }
-
- /* md5 response is 32 chars, + final \0 */
- p_sys->psz_response_md5 = malloc( 33 );
- MALLOC_CHECK( p_sys->psz_response_md5 )
-
- p_sys->p_first_queue = malloc( sizeof( audioscrobbler_queue_t ) );
- MALLOC_CHECK( p_sys->p_first_queue )
-
- p_sys->p_current_song = malloc( sizeof( audioscrobbler_song_t ) );
- MALLOC_CHECK( p_sys->p_current_song )
- time( &p_sys->p_current_song->time_playing );
-
- /* queues can't contain more than 10 songs */
- p_sys->p_first_queue->p_queue =
- malloc( 10 * sizeof( audioscrobbler_song_t ) );
- MALLOC_CHECK( p_sys->p_current_song )
-
- p_sys->p_first_queue->i_songs_nb = 0;
- p_sys->p_first_queue->p_next_queue = NULL;