Commit a0e351f5 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

demux/playlist: Don't use playlist_t.

parent fcaf3746
...@@ -459,7 +459,7 @@ static int Demux( demux_t *p_demux ) ...@@ -459,7 +459,7 @@ static int Demux( demux_t *p_demux )
psz_string = malloc( i_strlen*sizeof( char ) +1); psz_string = malloc( i_strlen*sizeof( char ) +1);
memcpy( psz_string, psz_backup, i_strlen ); memcpy( psz_string, psz_backup, i_strlen );
psz_string[i_strlen] = '\0'; psz_string[i_strlen] = '\0';
p_input = input_ItemNew( p_playlist, psz_string, psz_title_asx ); p_input = input_ItemNew( p_demux, psz_string, psz_title_asx );
input_ItemCopyOptions( p_current_input, p_input ); input_ItemCopyOptions( p_current_input, p_input );
input_ItemAddSubItem( p_current_input, p_input ); input_ItemAddSubItem( p_current_input, p_input );
free( psz_string ); free( psz_string );
...@@ -516,7 +516,7 @@ static int Demux( demux_t *p_demux ) ...@@ -516,7 +516,7 @@ static int Demux( demux_t *p_demux )
/* create the new entry */ /* create the new entry */
asprintf( &psz_name, "%d %s", i_entry_count, ( psz_title_entry ? psz_title_entry : p_current_input->psz_name ) ); asprintf( &psz_name, "%d %s", i_entry_count, ( psz_title_entry ? psz_title_entry : p_current_input->psz_name ) );
p_entry = input_ItemNewExt( p_playlist, psz_href, psz_name, i_options, (const char * const *)ppsz_options, -1 ); p_entry = input_ItemNewExt( p_demux, psz_href, psz_name, i_options, (const char * const *)ppsz_options, -1 );
FREENULL( psz_name ); FREENULL( psz_name );
input_ItemCopyOptions( p_current_input, p_entry ); input_ItemCopyOptions( p_current_input, p_entry );
while( i_options ) while( i_options )
......
...@@ -109,7 +109,6 @@ static int Demux( demux_t *p_demux ) ...@@ -109,7 +109,6 @@ static int Demux( demux_t *p_demux )
if( xml_ReaderRead( p_xml_reader ) != 1 ) if( xml_ReaderRead( p_xml_reader ) != 1 )
{ {
msg_Err( p_demux, "invalid file (no root node)" ); msg_Err( p_demux, "invalid file (no root node)" );
vlc_object_release( p_playlist );
return -1; return -1;
} }
...@@ -120,7 +119,6 @@ static int Demux( demux_t *p_demux ) ...@@ -120,7 +119,6 @@ static int Demux( demux_t *p_demux )
msg_Err( p_demux, "invalid root node %i, %s", msg_Err( p_demux, "invalid root node %i, %s",
xml_ReaderNodeType( p_xml_reader ), psz_elname ); xml_ReaderNodeType( p_xml_reader ), psz_elname );
free( psz_elname ); free( psz_elname );
vlc_object_release( p_playlist );
return -1; return -1;
} }
free( psz_elname ); free( psz_elname );
...@@ -258,16 +256,16 @@ static int Demux( demux_t *p_demux ) ...@@ -258,16 +256,16 @@ static int Demux( demux_t *p_demux )
if( !psz_elname ) return -1; if( !psz_elname ) return -1;
if( !strcmp( psz_elname, "entry" ) ) if( !strcmp( psz_elname, "entry" ) )
{ {
p_input = input_ItemNewExt( p_playlist, psz_mrl, psz_name, p_input = input_ItemNewExt( p_demux, psz_mrl, psz_name,
0, NULL, -1 ); 0, NULL, -1 );
if( psz_now ) if( psz_now )
input_item_SetNowPlaying( p_input, psz_now ); input_item_SetNowPlaying( p_input, psz_now );
if( psz_genre ) if( psz_genre )
input_item_SetGenre( p_input, psz_genre ); input_item_SetGenre( p_input, psz_genre );
if( psz_listeners ) if( psz_listeners )
msg_Err( p_playlist, "Unsupported meta listeners" ); msg_Err( p_demux, "Unsupported meta listeners" );
if( psz_bitrate ) if( psz_bitrate )
msg_Err( p_playlist, "Unsupported meta bitrate" ); msg_Err( p_demux, "Unsupported meta bitrate" );
input_ItemAddSubItem( p_current_input, p_input ); input_ItemAddSubItem( p_current_input, p_input );
vlc_gc_decref( p_input ); vlc_gc_decref( p_input );
......
...@@ -117,7 +117,7 @@ static int Demux( demux_t *p_demux ) ...@@ -117,7 +117,7 @@ static int Demux( demux_t *p_demux )
EnsureUTF8( psz_name ); EnsureUTF8( psz_name );
p_input = input_ItemNewExt( p_playlist, "dvb://", psz_name, 0, NULL, -1 ); p_input = input_ItemNewExt( p_demux, "dvb://", psz_name, 0, NULL, -1 );
for( i = 0; i< i_options; i++ ) for( i = 0; i< i_options; i++ )
{ {
EnsureUTF8( ppsz_options[i] ); EnsureUTF8( ppsz_options[i] );
......
...@@ -61,7 +61,6 @@ description:The now infamous Apple Macintosh commercial aired during the 1984 Su ...@@ -61,7 +61,6 @@ description:The now infamous Apple Macintosh commercial aired during the 1984 Su
struct demux_sys_t struct demux_sys_t
{ {
playlist_t *p_playlist;
input_item_t *p_current_input; input_item_t *p_current_input;
}; };
...@@ -98,7 +97,6 @@ int Import_GVP( vlc_object_t *p_this ) ...@@ -98,7 +97,6 @@ int Import_GVP( vlc_object_t *p_this )
p_demux->pf_control = Control; p_demux->pf_control = Control;
p_demux->pf_demux = Demux; p_demux->pf_demux = Demux;
MALLOC_ERR( p_demux->p_sys, demux_sys_t ); MALLOC_ERR( p_demux->p_sys, demux_sys_t );
p_demux->p_sys->p_playlist = NULL;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -111,8 +109,6 @@ void Close_GVP( vlc_object_t *p_this ) ...@@ -111,8 +109,6 @@ void Close_GVP( vlc_object_t *p_this )
demux_t *p_demux = (demux_t *)p_this; demux_t *p_demux = (demux_t *)p_this;
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
if( p_sys->p_playlist )
vlc_object_release( p_sys->p_playlist );
free( p_sys ); free( p_sys );
} }
...@@ -133,7 +129,6 @@ static int Demux( demux_t *p_demux ) ...@@ -133,7 +129,6 @@ static int Demux( demux_t *p_demux )
INIT_PLAYLIST_STUFF; INIT_PLAYLIST_STUFF;
p_sys->p_playlist = p_playlist;
p_sys->p_current_input = p_current_input; p_sys->p_current_input = p_current_input;
while( ( psz_line = stream_ReadLine( p_demux->s ) ) ) while( ( psz_line = stream_ReadLine( p_demux->s ) ) )
...@@ -206,7 +201,7 @@ static int Demux( demux_t *p_demux ) ...@@ -206,7 +201,7 @@ static int Demux( demux_t *p_demux )
} }
else else
{ {
p_input = input_ItemNewExt( p_sys->p_playlist, p_input = input_ItemNewExt( p_demux,
psz_url, psz_title, 0, NULL, -1 ); psz_url, psz_title, 0, NULL, -1 );
#define SADD_INFO( type, field ) if( field ) { input_ItemAddInfo( \ #define SADD_INFO( type, field ) if( field ) { input_ItemAddInfo( \
p_input, _("Google Video"), _(type), "%s", field ) ; } p_input, _("Google Video"), _(type), "%s", field ) ; }
...@@ -225,8 +220,6 @@ static int Demux( demux_t *p_demux ) ...@@ -225,8 +220,6 @@ static int Demux( demux_t *p_demux )
free( psz_title ); free( psz_title );
free( psz_description ); free( psz_description );
p_sys->p_playlist = NULL;
return 0; /* Needed for correct operation of go back */ return 0; /* Needed for correct operation of go back */
} }
......
...@@ -95,7 +95,7 @@ static int Demux( demux_t *p_demux ) ...@@ -95,7 +95,7 @@ static int Demux( demux_t *p_demux )
psz_url = (char *)malloc( len+1 ); psz_url = (char *)malloc( len+1 );
snprintf( psz_url, len+1, "dvd://%s", p_demux->psz_path ); snprintf( psz_url, len+1, "dvd://%s", p_demux->psz_path );
p_input = input_ItemNewExt( p_playlist, psz_url, psz_url, 0, NULL, -1 ); p_input = input_ItemNewExt( p_demux, psz_url, psz_url, 0, NULL, -1 );
input_ItemAddSubItem( p_current_input, p_input ); input_ItemAddSubItem( p_current_input, p_input );
vlc_gc_decref( p_input ); vlc_gc_decref( p_input );
......
...@@ -114,7 +114,7 @@ int Demux( demux_t *p_demux ) ...@@ -114,7 +114,7 @@ int Demux( demux_t *p_demux )
{ {
xml_elem_hnd_t pl_elements[] = xml_elem_hnd_t pl_elements[] =
{ {"dict", COMPLEX_CONTENT, {.cmplx = parse_plist_dict} } }; { {"dict", COMPLEX_CONTENT, {.cmplx = parse_plist_dict} } };
i_ret = parse_plist_node( p_demux, p_playlist, p_current_input, i_ret = parse_plist_node( p_demux, p_current_input,
NULL, p_xml_reader, "plist", NULL, p_xml_reader, "plist",
pl_elements ); pl_elements );
HANDLE_PLAY_AND_RELEASE; HANDLE_PLAY_AND_RELEASE;
...@@ -172,7 +172,7 @@ static bool parse_plist_node COMPLEX_INTERFACE ...@@ -172,7 +172,7 @@ static bool parse_plist_node COMPLEX_INTERFACE
if( !b_version_found ) if( !b_version_found )
msg_Warn( p_demux, "<plist> requires \"version\" attribute" ); msg_Warn( p_demux, "<plist> requires \"version\" attribute" );
return parse_dict( p_demux, p_playlist, p_input_item, NULL, p_xml_reader, return parse_dict( p_demux, p_input_item, NULL, p_xml_reader,
"plist", p_handlers ); "plist", p_handlers );
} }
...@@ -220,7 +220,6 @@ static bool parse_dict COMPLEX_INTERFACE ...@@ -220,7 +220,6 @@ static bool parse_dict COMPLEX_INTERFACE
if( p_handler->type == COMPLEX_CONTENT ) if( p_handler->type == COMPLEX_CONTENT )
{ {
if( p_handler->pf_handler.cmplx( p_demux, if( p_handler->pf_handler.cmplx( p_demux,
p_playlist,
p_input_item, p_input_item,
NULL, NULL,
p_xml_reader, p_xml_reader,
...@@ -316,7 +315,7 @@ static bool parse_plist_dict COMPLEX_INTERFACE ...@@ -316,7 +315,7 @@ static bool parse_plist_dict COMPLEX_INTERFACE
{NULL, UNKNOWN_CONTENT, {NULL} } {NULL, UNKNOWN_CONTENT, {NULL} }
}; };
return parse_dict( p_demux, p_playlist, p_input_item, NULL, p_xml_reader, return parse_dict( p_demux, p_input_item, NULL, p_xml_reader,
"dict", pl_elements ); "dict", pl_elements );
} }
...@@ -329,7 +328,7 @@ static bool parse_tracks_dict COMPLEX_INTERFACE ...@@ -329,7 +328,7 @@ static bool parse_tracks_dict COMPLEX_INTERFACE
{NULL, UNKNOWN_CONTENT, {NULL} } {NULL, UNKNOWN_CONTENT, {NULL} }
}; };
parse_dict( p_demux, p_playlist, p_input_item, NULL, p_xml_reader, parse_dict( p_demux, p_input_item, NULL, p_xml_reader,
"dict", tracks_elements ); "dict", tracks_elements );
msg_Info( p_demux, "added %i tracks successfully", msg_Info( p_demux, "added %i tracks successfully",
...@@ -357,7 +356,7 @@ static bool parse_track_dict COMPLEX_INTERFACE ...@@ -357,7 +356,7 @@ static bool parse_track_dict COMPLEX_INTERFACE
{NULL, UNKNOWN_CONTENT, {NULL} } {NULL, UNKNOWN_CONTENT, {NULL} }
}; };
i_ret = parse_dict( p_demux, p_playlist, p_input_item, p_track, i_ret = parse_dict( p_demux, p_input_item, p_track,
p_xml_reader, "dict", track_elements ); p_xml_reader, "dict", track_elements );
msg_Dbg( p_demux, "name: %s, artist: %s, album: %s, genre: %s, trackNum: %s, location: %s", msg_Dbg( p_demux, "name: %s, artist: %s, album: %s, genre: %s, trackNum: %s, location: %s",
...@@ -381,7 +380,7 @@ static bool parse_track_dict COMPLEX_INTERFACE ...@@ -381,7 +380,7 @@ static bool parse_track_dict COMPLEX_INTERFACE
memmove( psz_uri + 7, psz_uri + 17, strlen( psz_uri ) - 9 ); memmove( psz_uri + 7, psz_uri + 17, strlen( psz_uri ) - 9 );
msg_Info( p_demux, "Adding '%s'", psz_uri ); msg_Info( p_demux, "Adding '%s'", psz_uri );
p_new_input = input_ItemNewExt( p_playlist, psz_uri, p_new_input = input_ItemNewExt( p_demux, psz_uri,
NULL, 0, NULL, -1 ); NULL, 0, NULL, -1 );
input_ItemAddSubItem( p_input_item, p_new_input ); input_ItemAddSubItem( p_input_item, p_new_input );
...@@ -488,7 +487,7 @@ static bool add_meta( input_item_t *p_input_item, ...@@ -488,7 +487,7 @@ static bool add_meta( input_item_t *p_input_item,
*/ */
static bool skip_element COMPLEX_INTERFACE static bool skip_element COMPLEX_INTERFACE
{ {
VLC_UNUSED(p_demux); VLC_UNUSED(p_playlist); VLC_UNUSED(p_input_item); VLC_UNUSED(p_demux); VLC_UNUSED(p_input_item);
VLC_UNUSED(p_track); VLC_UNUSED(p_handlers); VLC_UNUSED(p_track); VLC_UNUSED(p_handlers);
char *psz_endname; char *psz_endname;
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
const char *psz_name,\ const char *psz_name,\
char *psz_value) char *psz_value)
#define COMPLEX_INTERFACE (demux_t *p_demux,\ #define COMPLEX_INTERFACE (demux_t *p_demux,\
playlist_t *p_playlist,\
input_item_t *p_input_item,\ input_item_t *p_input_item,\
track_elem_t *p_track,\ track_elem_t *p_track,\
xml_reader_t *p_xml_reader,\ xml_reader_t *p_xml_reader,\
......
...@@ -182,7 +182,7 @@ static int Demux( demux_t *p_demux ) ...@@ -182,7 +182,7 @@ static int Demux( demux_t *p_demux )
b_cleanup = true; b_cleanup = true;
if( !psz_mrl ) goto error; if( !psz_mrl ) goto error;
p_input = input_ItemNewExt( p_playlist, psz_mrl, psz_name, p_input = input_ItemNewExt( p_demux, psz_mrl, psz_name,
0, NULL, i_duration ); 0, NULL, i_duration );
if ( psz_artist && *psz_artist ) if ( psz_artist && *psz_artist )
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include <vlc_playlist.h> #include <vlc_input.h>
char *ProcessMRL( char *, char * ); char *ProcessMRL( char *, char * );
char *FindPrefix( demux_t * ); char *FindPrefix( demux_t * );
...@@ -77,11 +78,8 @@ int Import_iTML ( vlc_object_t * ); ...@@ -77,11 +78,8 @@ int Import_iTML ( vlc_object_t * );
void Close_iTML ( vlc_object_t * ); void Close_iTML ( vlc_object_t * );
#define INIT_PLAYLIST_STUFF \ #define INIT_PLAYLIST_STUFF \
playlist_t *p_playlist = pl_Yield( p_demux ); \
input_thread_t *p_input_thread = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT ); \ 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 ); input_item_t *p_current_input = input_GetItem( p_input_thread );
#define HANDLE_PLAY_AND_RELEASE \ #define HANDLE_PLAY_AND_RELEASE \
vlc_object_release( p_input_thread ); \ vlc_object_release( p_input_thread );
vlc_object_release( p_playlist );
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment