char *psz_parse = NULL;
char *psz_backup = NULL;
bool b_entry = false;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
/* init txt */
if( p_sys->i_data_len < 0 )
STARTMARK
#endif
}
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
return 0; /* Needed for correct operation of go back */
}
char *psz_mrl = NULL, *psz_name = NULL, *psz_genre = NULL;
char *psz_now = NULL, *psz_listeners = NULL, *psz_bitrate = NULL;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
p_xml = p_sys->p_xml = xml_Create( p_demux );
if( !p_xml ) return -1;
free( psz_elname );
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
return 0; /* Needed for correct operation of go back */
}
{
char *psz_line;
input_item_t *p_input;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
while( (psz_line = stream_ReadLine( p_demux->s )) )
{
free( psz_line );
}
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
return 0; /* Needed for correct operation of go back */
}
char *psz_description = NULL;
input_item_t *p_input;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
p_sys->p_current_input = p_current_input;
vlc_gc_decref( p_input );
}
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
free( psz_version );
free( psz_url );
size_t len = 0;
input_item_t *p_input;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
len = strlen( "dvd://" ) + strlen( p_demux->psz_path )
- strlen( "VIDEO_TS.IFO" );
input_item_AddSubItem( p_current_input, p_input );
vlc_gc_decref( p_input );
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
return 0; /* Needed for correct operation of go back */
}
xml_reader_t *p_xml_reader = NULL;
char *psz_name = NULL;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
p_demux->p_sys->i_ntracks = 0;
/* create new xml parser from stream */
parse_plist_node( p_demux, p_current_input, NULL, p_xml_reader, "plist",
pl_elements );
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
end:
free( psz_name );
bool b_cleanup = false;
input_item_t *p_input;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
psz_line = stream_ReadLine( p_demux->s );
while( psz_line )
b_cleanup = false;
}
}
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
var_Destroy( p_demux, "m3u-extvlcopt" );
return 0; /* Needed for correct operation of go back */
}
set_callbacks( Import_ZPL, Close_ZPL )
vlc_module_end ()
+input_item_t * GetCurrentItem(demux_t *p_demux)
+{
+ input_thread_t *p_input_thread = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT );;
+ input_item_t *p_current_input = input_GetItem( p_input_thread );
+ vlc_gc_incref(p_current_input);
+ vlc_object_release(p_input_thread);
+ return p_current_input;
+}
/**
* Find directory part of the path to the playlist file, in case of
*****************************************************************************/
#include <vlc_input.h>
+#include <vlc_playlist.h>
char *ProcessMRL( char *, char * );
char *FindPrefix( demux_t * );
int Import_ZPL ( vlc_object_t * );
void Close_ZPL ( vlc_object_t * );
-#define INIT_PLAYLIST_STUFF \
- input_thread_t *p_input_thread = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT ); \
- input_item_t *p_current_input = input_GetItem( p_input_thread );
-
-#define HANDLE_PLAY_AND_RELEASE \
- vlc_object_release( p_input_thread );
-
+extern input_item_t * GetCurrentItem(demux_t *p_demux);
#define STANDARD_DEMUX_INIT_MSG( msg ) do { \
DEMUX_INIT_COMMON(); \
int i_key_length;
input_item_t *p_input;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
while( ( psz_line = stream_ReadLine( p_demux->s ) ) )
{
free( psz_name );
psz_name = NULL;
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
return 0; /* Needed for correct operation of go back */
}
int i_type;
input_item_t *p_input;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
p_xml = xml_Create( p_demux );
if( !p_xml )
xml_ReaderDelete( p_xml, p_xml_reader );
xml_Delete( p_xml );
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
return 0; /* Needed for correct operation of go back */
error:
if( p_xml )
xml_Delete( p_xml );
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
return -1;
}
char *psz_mimetype = NULL;
int i_volume = 100;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
p_xml = xml_Create( p_demux );
if( !p_xml )
if( p_xml )
xml_Delete( p_xml );
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
free( psz_href );
free( psz_moviename );
bool b_cleanup = false;
input_item_t *p_input;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
psz_line = stream_ReadLine( p_demux->s );
while( psz_line )
b_cleanup = false;
}
}
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
var_Destroy( p_demux, "m3u-extvlcopt" );
return 0; /* Needed for correct operation of go back */
}
input_item_t *p_child = NULL;
char *psz_line;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
while( ( psz_line = stream_ReadLine( p_demux->s ) ) )
{
input_item_AddSubItem( p_current_input, p_child );
vlc_gc_decref( p_child );
- HANDLE_PLAY_AND_RELEASE
+ vlc_gc_decref(p_current_input);
return 0; /* Needed for correct operation of go back */
}
xml_reader_t *p_xml_reader = NULL;
char *psz_eltname = NULL;
int i_ret = -1;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
p_xml = xml_Create( p_demux );
if( !p_xml )
if( p_xml )
xml_Delete( p_xml );
free( psz_eltname );
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
return i_ret;
}
char *psz_parse;
input_item_t *p_input;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
psz_line = stream_ReadLine( p_demux->s );
while( psz_line )
psz_line = stream_ReadLine( p_demux->s );
}
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
var_Destroy( p_demux, "wpl-extvlcopt" );
return 0; /* Needed for correct operation of go back */
}
xml_t *p_xml = NULL;
xml_reader_t *p_xml_reader = NULL;
char *psz_name = NULL;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
p_demux->p_sys->pp_tracklist = NULL;
p_demux->p_sys->i_tracklist_entries = 0;
p_demux->p_sys->i_track_id = -1;
}
end:
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
if( p_xml_reader )
xml_ReaderDelete( p_xml, p_xml_reader );
if( p_xml )
*psz_description = NULL, *psz_url = NULL, *psz_copyright = NULL,
*psz_mrl = NULL;
- INIT_PLAYLIST_STUFF;
+ input_item_t *p_current_input = GetCurrentItem(p_demux);
psz_line = stream_ReadLine( p_demux->s );
char *psz_parse = psz_line;
psz_line = stream_ReadLine( p_demux->s );
}
- HANDLE_PLAY_AND_RELEASE;
+ vlc_gc_decref(p_current_input);
var_Destroy( p_demux, "zpl-extvlcopt" );
return 0; /* Needed for correct operation of go back */
}