Changeset a0e351f5a791d05b4e38bf835064055d10730efc
- Timestamp:
- 06/14/08 17:36:03
(2 months ago)
- Author:
- Pierre d'Herbemont <pdherbemont@videolan.org>
- git-committer:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1213457763 +0200
- git-parent:
[fcaf3746c77c7aaa692e39b3c377321f2155bda1]
- git-author:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1213457763 +0200
- Message:
demux/playlist: Don't use playlist_t.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3561b9b |
ra0e351f |
|
| 460 | 460 | memcpy( psz_string, psz_backup, i_strlen ); |
|---|
| 461 | 461 | psz_string[i_strlen] = '\0'; |
|---|
| 462 | | p_input = input_ItemNew( p_playlist, psz_string, psz_title_asx ); |
|---|
| | 462 | p_input = input_ItemNew( p_demux, psz_string, psz_title_asx ); |
|---|
| 463 | 463 | input_ItemCopyOptions( p_current_input, p_input ); |
|---|
| 464 | 464 | input_ItemAddSubItem( p_current_input, p_input ); |
|---|
| … | … | |
| 517 | 517 | asprintf( &psz_name, "%d %s", i_entry_count, ( psz_title_entry ? psz_title_entry : p_current_input->psz_name ) ); |
|---|
| 518 | 518 | |
|---|
| 519 | | p_entry = input_ItemNewExt( p_playlist, psz_href, psz_name, i_options, (const char * const *)ppsz_options, -1 ); |
|---|
| | 519 | p_entry = input_ItemNewExt( p_demux, psz_href, psz_name, i_options, (const char * const *)ppsz_options, -1 ); |
|---|
| 520 | 520 | FREENULL( psz_name ); |
|---|
| 521 | 521 | input_ItemCopyOptions( p_current_input, p_entry ); |
|---|
| r3561b9b |
ra0e351f |
|
| 110 | 110 | { |
|---|
| 111 | 111 | msg_Err( p_demux, "invalid file (no root node)" ); |
|---|
| 112 | | vlc_object_release( p_playlist ); |
|---|
| 113 | 112 | return -1; |
|---|
| 114 | 113 | } |
|---|
| … | … | |
| 121 | 120 | xml_ReaderNodeType( p_xml_reader ), psz_elname ); |
|---|
| 122 | 121 | free( psz_elname ); |
|---|
| 123 | | vlc_object_release( p_playlist ); |
|---|
| 124 | 122 | return -1; |
|---|
| 125 | 123 | } |
|---|
| … | … | |
| 259 | 257 | if( !strcmp( psz_elname, "entry" ) ) |
|---|
| 260 | 258 | { |
|---|
| 261 | | p_input = input_ItemNewExt( p_playlist, psz_mrl, psz_name, |
|---|
| | 259 | p_input = input_ItemNewExt( p_demux, psz_mrl, psz_name, |
|---|
| 262 | 260 | 0, NULL, -1 ); |
|---|
| 263 | 261 | if( psz_now ) |
|---|
| … | … | |
| 266 | 264 | input_item_SetGenre( p_input, psz_genre ); |
|---|
| 267 | 265 | if( psz_listeners ) |
|---|
| 268 | | msg_Err( p_playlist, "Unsupported meta listeners" ); |
|---|
| | 266 | msg_Err( p_demux, "Unsupported meta listeners" ); |
|---|
| 269 | 267 | if( psz_bitrate ) |
|---|
| 270 | | msg_Err( p_playlist, "Unsupported meta bitrate" ); |
|---|
| | 268 | msg_Err( p_demux, "Unsupported meta bitrate" ); |
|---|
| 271 | 269 | |
|---|
| 272 | 270 | input_ItemAddSubItem( p_current_input, p_input ); |
|---|
| r3561b9b |
ra0e351f |
|
| 118 | 118 | EnsureUTF8( psz_name ); |
|---|
| 119 | 119 | |
|---|
| 120 | | p_input = input_ItemNewExt( p_playlist, "dvb://", psz_name, 0, NULL, -1 ); |
|---|
| | 120 | p_input = input_ItemNewExt( p_demux, "dvb://", psz_name, 0, NULL, -1 ); |
|---|
| 121 | 121 | for( i = 0; i< i_options; i++ ) |
|---|
| 122 | 122 | { |
|---|
| r3561b9b |
ra0e351f |
|
| 62 | 62 | struct demux_sys_t |
|---|
| 63 | 63 | { |
|---|
| 64 | | playlist_t *p_playlist; |
|---|
| 65 | 64 | input_item_t *p_current_input; |
|---|
| 66 | 65 | }; |
|---|
| … | … | |
| 99 | 98 | p_demux->pf_demux = Demux; |
|---|
| 100 | 99 | MALLOC_ERR( p_demux->p_sys, demux_sys_t ); |
|---|
| 101 | | p_demux->p_sys->p_playlist = NULL; |
|---|
| 102 | 100 | |
|---|
| 103 | 101 | return VLC_SUCCESS; |
|---|
| … | … | |
| 112 | 110 | demux_sys_t *p_sys = p_demux->p_sys; |
|---|
| 113 | 111 | |
|---|
| 114 | | if( p_sys->p_playlist ) |
|---|
| 115 | | vlc_object_release( p_sys->p_playlist ); |
|---|
| 116 | 112 | free( p_sys ); |
|---|
| 117 | 113 | } |
|---|
| … | … | |
| 134 | 130 | INIT_PLAYLIST_STUFF; |
|---|
| 135 | 131 | |
|---|
| 136 | | p_sys->p_playlist = p_playlist; |
|---|
| 137 | 132 | p_sys->p_current_input = p_current_input; |
|---|
| 138 | 133 | |
|---|
| … | … | |
| 207 | 202 | else |
|---|
| 208 | 203 | { |
|---|
| 209 | | p_input = input_ItemNewExt( p_sys->p_playlist, |
|---|
| | 204 | p_input = input_ItemNewExt( p_demux, |
|---|
| 210 | 205 | psz_url, psz_title, 0, NULL, -1 ); |
|---|
| 211 | 206 | #define SADD_INFO( type, field ) if( field ) { input_ItemAddInfo( \ |
|---|
| … | … | |
| 226 | 221 | free( psz_description ); |
|---|
| 227 | 222 | |
|---|
| 228 | | p_sys->p_playlist = NULL; |
|---|
| 229 | | |
|---|
| 230 | 223 | return 0; /* Needed for correct operation of go back */ |
|---|
| 231 | 224 | } |
|---|
| r3561b9b |
ra0e351f |
|
| 96 | 96 | snprintf( psz_url, len+1, "dvd://%s", p_demux->psz_path ); |
|---|
| 97 | 97 | |
|---|
| 98 | | p_input = input_ItemNewExt( p_playlist, psz_url, psz_url, 0, NULL, -1 ); |
|---|
| | 98 | p_input = input_ItemNewExt( p_demux, psz_url, psz_url, 0, NULL, -1 ); |
|---|
| 99 | 99 | input_ItemAddSubItem( p_current_input, p_input ); |
|---|
| 100 | 100 | vlc_gc_decref( p_input ); |
|---|
| r3561b9b |
ra0e351f |
|
| 115 | 115 | xml_elem_hnd_t pl_elements[] = |
|---|
| 116 | 116 | { {"dict", COMPLEX_CONTENT, {.cmplx = parse_plist_dict} } }; |
|---|
| 117 | | i_ret = parse_plist_node( p_demux, p_playlist, p_current_input, |
|---|
| | 117 | i_ret = parse_plist_node( p_demux, p_current_input, |
|---|
| 118 | 118 | NULL, p_xml_reader, "plist", |
|---|
| 119 | 119 | pl_elements ); |
|---|
| … | … | |
| 173 | 173 | msg_Warn( p_demux, "<plist> requires \"version\" attribute" ); |
|---|
| 174 | 174 | |
|---|
| 175 | | return parse_dict( p_demux, p_playlist, p_input_item, NULL, p_xml_reader, |
|---|
| | 175 | return parse_dict( p_demux, p_input_item, NULL, p_xml_reader, |
|---|
| 176 | 176 | "plist", p_handlers ); |
|---|
| 177 | 177 | } |
|---|
| … | … | |
| 221 | 221 | { |
|---|
| 222 | 222 | if( p_handler->pf_handler.cmplx( p_demux, |
|---|
| 223 | | p_playlist, |
|---|
| 224 | 223 | p_input_item, |
|---|
| 225 | 224 | NULL, |
|---|
| … | … | |
| 317 | 316 | }; |
|---|
| 318 | 317 | |
|---|
| 319 | | return parse_dict( p_demux, p_playlist, p_input_item, NULL, p_xml_reader, |
|---|
| | 318 | return parse_dict( p_demux, p_input_item, NULL, p_xml_reader, |
|---|
| 320 | 319 | "dict", pl_elements ); |
|---|
| 321 | 320 | } |
|---|
| … | … | |
| 330 | 329 | }; |
|---|
| 331 | 330 | |
|---|
| 332 | | parse_dict( p_demux, p_playlist, p_input_item, NULL, p_xml_reader, |
|---|
| | 331 | parse_dict( p_demux, p_input_item, NULL, p_xml_reader, |
|---|
| 333 | 332 | "dict", tracks_elements ); |
|---|
| 334 | 333 | |
|---|
| … | … | |
| 358 | 357 | }; |
|---|
| 359 | 358 | |
|---|
| 360 | | i_ret = parse_dict( p_demux, p_playlist, p_input_item, p_track, |
|---|
| | 359 | i_ret = parse_dict( p_demux, p_input_item, p_track, |
|---|
| 361 | 360 | p_xml_reader, "dict", track_elements ); |
|---|
| 362 | 361 | |
|---|
| … | … | |
| 382 | 381 | msg_Info( p_demux, "Adding '%s'", psz_uri ); |
|---|
| 383 | 382 | |
|---|
| 384 | | p_new_input = input_ItemNewExt( p_playlist, psz_uri, |
|---|
| | 383 | p_new_input = input_ItemNewExt( p_demux, psz_uri, |
|---|
| 385 | 384 | NULL, 0, NULL, -1 ); |
|---|
| 386 | 385 | input_ItemAddSubItem( p_input_item, p_new_input ); |
|---|
| … | … | |
| 489 | 488 | static bool skip_element COMPLEX_INTERFACE |
|---|
| 490 | 489 | { |
|---|
| 491 | | VLC_UNUSED(p_demux); VLC_UNUSED(p_playlist); VLC_UNUSED(p_input_item); |
|---|
| | 490 | VLC_UNUSED(p_demux); VLC_UNUSED(p_input_item); |
|---|
| 492 | 491 | VLC_UNUSED(p_track); VLC_UNUSED(p_handlers); |
|---|
| 493 | 492 | char *psz_endname; |
|---|
| r449fd28 |
ra0e351f |
|
| 42 | 42 | char *psz_value) |
|---|
| 43 | 43 | #define COMPLEX_INTERFACE (demux_t *p_demux,\ |
|---|
| 44 | | playlist_t *p_playlist,\ |
|---|
| 45 | 44 | input_item_t *p_input_item,\ |
|---|
| 46 | 45 | track_elem_t *p_track,\ |
|---|
| r3561b9b |
ra0e351f |
|
| 183 | 183 | if( !psz_mrl ) goto error; |
|---|
| 184 | 184 | |
|---|
| 185 | | p_input = input_ItemNewExt( p_playlist, psz_mrl, psz_name, |
|---|
| | 185 | p_input = input_ItemNewExt( p_demux, psz_mrl, psz_name, |
|---|
| 186 | 186 | 0, NULL, i_duration ); |
|---|
| 187 | 187 | |
|---|
| r6300760 |
ra0e351f |
|
| 22 | 22 | *****************************************************************************/ |
|---|
| 23 | 23 | |
|---|
| 24 | | #include <vlc_playlist.h> |
|---|
| | 24 | #include <vlc_input.h> |
|---|
| | 25 | |
|---|
| 25 | 26 | char *ProcessMRL( char *, char * ); |
|---|
| 26 | 27 | char *FindPrefix( demux_t * ); |
|---|
| … | … | |
| 78 | 79 | |
|---|
| 79 | 80 | #define INIT_PLAYLIST_STUFF \ |
|---|
| 80 | | playlist_t *p_playlist = pl_Yield( p_demux ); \ |
|---|
| 81 | 81 | input_thread_t *p_input_thread = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT ); \ |
|---|
| 82 | 82 | input_item_t *p_current_input = input_GetItem( p_input_thread ); |
|---|
| 83 | 83 | |
|---|
| 84 | 84 | #define HANDLE_PLAY_AND_RELEASE \ |
|---|
| 85 | | vlc_object_release( p_input_thread ); \ |
|---|
| 86 | | vlc_object_release( p_playlist ); |
|---|
| 87 | | |
|---|
| | 85 | vlc_object_release( p_input_thread ); |
|---|