X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fdemux%2Fplaylist%2Fgvp.c;h=2747d985c2f66ce94c93b20b21e8c3aef5e538bd;hb=c7bc593d4262976fd884a1629e85b09954aa7c44;hp=fdec2fbd86e97e505699aa9202baab24244fc54a;hpb=a0e351f5a791d05b4e38bf835064055d10730efc;p=vlc diff --git a/modules/demux/playlist/gvp.c b/modules/demux/playlist/gvp.c index fdec2fbd86..2747d985c2 100644 --- a/modules/demux/playlist/gvp.c +++ b/modules/demux/playlist/gvp.c @@ -96,7 +96,9 @@ int Import_GVP( vlc_object_t *p_this ) 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; } @@ -127,7 +129,9 @@ static int Demux( demux_t *p_demux ) 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; @@ -178,9 +182,8 @@ static int Demux( demux_t *p_demux ) 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; } @@ -201,18 +204,19 @@ static int Demux( demux_t *p_demux ) } 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 );