/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <ctype.h> /* isspace() */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <vlc/vlc.h>
#include <vlc_demux.h>
-#include <errno.h> /* ENOMEM */
+#include <ctype.h>
#include <vlc_charset.h>
#include "playlist.h"
#include "vlc_meta.h"
demux_sys_t *p_sys = p_demux->p_sys;
unsigned len = psz_source_end - psz_source_start;
- if( *ppsz_string ) free( *ppsz_string );
+ free( *ppsz_string );
char *buf = *ppsz_string = malloc ((len * (1 + !p_sys->b_utf8)) + 1);
if (buf == NULL)
int E_(Import_ASX)( vlc_object_t *p_this )
{
demux_t *p_demux = (demux_t *)p_this;
- uint8_t *p_peek;
+ const uint8_t *p_peek;
CHECK_PEEK( p_peek, 10 );
// skip over possible leading empty lines and empty spaces
demux_t *p_demux = (demux_t *)p_this;
demux_sys_t *p_sys = p_demux->p_sys;
- if( p_sys->psz_prefix ) free( p_sys->psz_prefix );
- if( p_sys->psz_data ) free( p_sys->psz_data );
+ free( p_sys->psz_prefix );
+ free( p_sys->psz_data );
free( p_sys );
}
p_sys->i_data_len += 1024;
p_sys->psz_data = realloc( p_sys->psz_data, p_sys->i_data_len * sizeof( char * ) +1 );
}
- if( p_sys->i_data_len <= 0 ) return VLC_EGENERIC;
+ if( p_sys->i_data_len <= 0 ) return -1;
}
psz_parse = p_sys->psz_data;
if( psz_moreinfo_entry ) input_item_SetURL( p_entry, psz_moreinfo_entry );
if( psz_abstract_entry ) input_item_SetDescription( p_entry, psz_abstract_entry );
input_ItemAddSubItem( p_current_input, p_entry );
+ vlc_gc_decref( p_entry );
}
- /* cleanup entry */
- FREENULL( psz_href )
- FREENULL( psz_title_entry )
- FREENULL( psz_base_entry )
- FREENULL( psz_artist_entry )
- FREENULL( psz_copyright_entry )
- FREENULL( psz_moreinfo_entry )
- FREENULL( psz_abstract_entry )
+ /* cleanup entry */;
+ FREENULL( psz_href );
+ FREENULL( psz_title_entry );
+ FREENULL( psz_base_entry );
+ FREENULL( psz_artist_entry );
+ FREENULL( psz_copyright_entry );
+ FREENULL( psz_moreinfo_entry );
+ FREENULL( psz_abstract_entry );
b_entry = VLC_FALSE;
}
else if( !strncasecmp( psz_parse, "<Entry", 6 ) )
}
else if( !strncasecmp( psz_parse, "</ASX", 5 ) )
{
- vlc_mutex_lock( &p_current_input->lock );
if( psz_title_asx ) input_item_SetTitle( p_current_input, psz_title_asx );
if( psz_artist_asx ) input_item_SetArtist( p_current_input, psz_artist_asx );
if( psz_copyright_asx ) input_item_SetCopyright( p_current_input, psz_copyright_asx );
if( psz_moreinfo_asx ) input_item_SetURL( p_current_input, psz_moreinfo_asx );
if( psz_abstract_asx ) input_item_SetDescription( p_current_input, psz_abstract_asx );
- vlc_mutex_unlock( &p_current_input->lock );
FREENULL( psz_base_asx );
FREENULL( psz_title_asx );
FREENULL( psz_artist_asx );
#endif
}
HANDLE_PLAY_AND_RELEASE;
- return -1; /* Needed for correct operation of go back */
+ return 0; /* Needed for correct operation of go back */
}
static int Control( demux_t *p_demux, int i_query, va_list args )
{
+ VLC_UNUSED(p_demux); VLC_UNUSED(i_query); VLC_UNUSED(args);
return VLC_EGENERIC;
}