STANDARD_DEMUX_INIT_MSG( "using Google Video Playlist (gvp) import" );
p_demux->pf_control = Control;
p_demux->pf_demux = Demux;
- MALLOC_ERR( p_demux->p_sys, demux_sys_t );
+ p_demux->p_sys = malloc( sizeof( demux_sys_t ) );
+ if( !p_demux->p_sys )
+ return VLC_ENOMEM;
return VLC_SUCCESS;
}
char *psz_description = NULL;
input_item_t *p_input;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
+
+ input_item_node_t *p_subitems = input_item_node_Create( p_current_input );
p_sys->p_current_input = p_current_input;
else
{
/* handle multi-line descriptions */
- buf = malloc( strlen( psz_description )
- + strlen( psz_attrvalue ) + 2 );
- sprintf( buf, "%s\n%s", psz_description, psz_attrvalue );
+ if( asprintf( &buf, "%s\n%s", psz_description, psz_attrvalue ) == -1 )
+ buf = NULL;
free( psz_description );
psz_description = buf;
}
}
else
{
- p_input = input_ItemNewExt( p_demux,
- psz_url, psz_title, 0, NULL, -1 );
-#define SADD_INFO( type, field ) if( field ) { input_ItemAddInfo( \
- p_input, _("Google Video"), _(type), "%s", field ) ; }
+ p_input = input_item_New( p_demux, psz_url, psz_title );
+#define SADD_INFO( type, field ) if( field ) { input_item_AddInfo( \
+ p_input, _("Google Video"), type, "%s", field ) ; }
SADD_INFO( "gvp_version", psz_version );
SADD_INFO( "docid", psz_docid );
SADD_INFO( "description", psz_description );
- input_ItemAddSubItem( p_current_input, p_input );
+ input_item_node_AppendItem( p_subitems, p_input );
vlc_gc_decref( p_input );
}
- HANDLE_PLAY_AND_RELEASE;
+ input_item_node_PostAndDelete( p_subitems );
+
+ vlc_gc_decref(p_current_input);
free( psz_version );
free( psz_url );