]> git.sesse.net Git - vlc/blobdiff - modules/demux/playlist/gvp.c
macosx: retain objects in MainMenu object
[vlc] / modules / demux / playlist / gvp.c
index e66b95fc4a934b284ec1915bbf106c362785ba8b..1b810de1cda449d87cff638e64047be9960a62b2 100644 (file)
@@ -1,24 +1,24 @@
 /*****************************************************************************
  * gvp.c: Google Video Playlist demuxer
  *****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
+ * Copyright (C) 2006 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Antoine Cellerier <dionoea @t videolan d.t org>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /**
@@ -68,7 +68,6 @@ struct demux_sys_t
  * Local prototypes
  *****************************************************************************/
 static int Demux( demux_t *p_demux);
-static int Control( demux_t *p_demux, int i_query, va_list args );
 
 /*****************************************************************************
  * Import_GVP: main import function
@@ -129,7 +128,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;
 
@@ -202,18 +203,19 @@ static int Demux( demux_t *p_demux )
     }
     else
     {
-        p_input = input_item_NewExt( p_demux,
-                                    psz_url, psz_title, 0, NULL, -1 );
+        p_input = input_item_New( psz_url, psz_title );
 #define SADD_INFO( type, field ) if( field ) { input_item_AddInfo( \
-                    p_input, _("Google Video"), _(type), "%s", field ) ; }
+                    p_input, _("Google Video"), type, "%s", field ) ; }
         SADD_INFO( "gvp_version", psz_version );
         SADD_INFO( "docid", psz_docid );
         SADD_INFO( "description", psz_description );
-        input_item_AddSubItem( 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 );
@@ -223,9 +225,3 @@ static int Demux( demux_t *p_demux )
 
     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;
-}