]> git.sesse.net Git - vlc/blob - modules/demux/m3u.c
* increase priority real demuxer, lower priority m3u demuxer. It was parsing ram...
[vlc] / modules / demux / m3u.c
1 /*****************************************************************************
2  * m3u.c: a meta demux to parse pls, m3u, asx et b4s playlists
3  *****************************************************************************
4  * Copyright (C) 2001-2004 VideoLAN
5  * $Id$
6  *
7  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
8  *          Gildas Bazin <gbazin@netcourrier.com>
9  *          Clément Stenac <zorglub@via.ecp.fr>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
24  *****************************************************************************/
25
26 /*****************************************************************************
27  * Preamble
28  *****************************************************************************/
29 #include <stdlib.h>                                      /* malloc(), free() */
30
31 #include <vlc/vlc.h>
32 #include <vlc/input.h>
33 #include <vlc_playlist.h>
34
35 /*****************************************************************************
36  * Constants and structures
37  *****************************************************************************/
38 #define MAX_LINE 8192
39
40 #define TYPE_UNKNOWN 0
41 #define TYPE_M3U 1
42 #define TYPE_ASX 2
43 #define TYPE_HTML 3
44 #define TYPE_PLS 4
45 #define TYPE_B4S 5
46 #define TYPE_WMP 6
47
48 struct demux_sys_t
49 {
50     int i_type;                                   /* playlist type (m3u/asx) */
51 };
52
53 /*****************************************************************************
54  * Local prototypes
55  *****************************************************************************/
56 static int  Activate  ( vlc_object_t * );
57 static void Deactivate( vlc_object_t * );
58 static int  Demux     ( demux_t * );
59 static int Control    ( demux_t *, int, va_list );
60
61 /*****************************************************************************
62  * Module descriptor
63  *****************************************************************************/
64 vlc_module_begin();
65     set_description( _("Playlist metademux") );
66     set_capability( "demux2", 10 );
67     set_callbacks( Activate, Deactivate );
68     add_shortcut( "m3u" );
69     add_shortcut( "asx" );
70     add_shortcut( "html" );
71     add_shortcut( "pls" );
72     add_shortcut( "b4s" );
73 vlc_module_end();
74
75 /*****************************************************************************
76  * Activate: initializes m3u demux structures
77  *****************************************************************************/
78 static int Activate( vlc_object_t * p_this )
79 {
80     demux_t *p_demux = (demux_t *)p_this;
81     char    *psz_ext;
82     int     i_type  = TYPE_UNKNOWN;
83     int     i_type2 = TYPE_UNKNOWN;
84
85     p_demux->pf_control = Control;
86     p_demux->pf_demux = Demux;
87
88     /* Check for m3u/asx file extension or if the demux has been forced */
89     psz_ext = strrchr ( p_demux->psz_path, '.' );
90
91     if( ( psz_ext && !strcasecmp( psz_ext, ".m3u") ) ||
92         /* a .ram file can contain a single rtsp link */
93         ( psz_ext && !strcasecmp( psz_ext, ".ram") ) ||
94         ( p_demux->psz_demux && !strcmp(p_demux->psz_demux, "m3u") ) )
95     {
96         i_type = TYPE_M3U;
97     }
98     else if( ( psz_ext && !strcasecmp( psz_ext, ".asx") ) ||
99              ( p_demux->psz_demux && !strcmp(p_demux->psz_demux, "asx") ) )
100     {
101         i_type = TYPE_ASX;
102     }
103     else if( ( psz_ext && !strcasecmp( psz_ext, ".html") ) ||
104              ( p_demux->psz_demux && !strcmp(p_demux->psz_demux, "html") ) )
105     {
106         i_type = TYPE_HTML;
107     }
108     else if( ( psz_ext && !strcasecmp( psz_ext, ".pls") ) ||
109              ( p_demux->psz_demux && !strcmp(p_demux->psz_demux, "pls") ) )
110     {
111         i_type = TYPE_PLS;
112     }
113     else if( ( psz_ext && !strcasecmp( psz_ext, ".b4s") ) ||
114              ( p_demux->psz_demux && !strcmp(p_demux->psz_demux, "b4s") ) )
115     {
116         i_type = TYPE_B4S;
117     }
118
119     /* we had no luck looking at the file extention, so we have a look
120      * at the content. This is useful for .asp, .php and similar files
121      * that are actually html. Also useful for some asx files that have
122      * another extension */
123     /* XXX we double check for file != m3u as some asx ... are just m3u file */
124     if( i_type != TYPE_M3U )
125     {
126         uint8_t *p_peek;
127         int i_size = stream_Peek( p_demux->s, &p_peek, MAX_LINE );
128         i_size -= sizeof("[Reference]") - 1;
129
130         if( i_size > 0 )
131         {
132             while( i_size &&
133                    strncasecmp(p_peek, "[playlist]", sizeof("[playlist]") - 1)
134                    && strncasecmp( p_peek, "[Reference]", sizeof("[Reference]") - 1 )
135                    && strncasecmp( p_peek, "<html>", sizeof("<html>") - 1 )
136                    && strncasecmp( p_peek, "<asx", sizeof("<asx") - 1 )
137                    && strncasecmp( p_peek, "<?xml", sizeof("<?xml") -1 ) )
138             {
139                 p_peek++;
140                 i_size--;
141             }
142             if( !i_size )
143             {
144                 ;
145             }
146             else if( !strncasecmp( p_peek, "[playlist]", sizeof("[playlist]") -1 ) )
147             {
148                 i_type2 = TYPE_PLS;
149             }
150             else if( !strncasecmp( p_peek, "[Reference]", sizeof("[Reference]") -1 ) )
151             {
152                 i_type2 = TYPE_WMP;
153             }
154             else if( !strncasecmp( p_peek, "<html>", sizeof("<html>") -1 ) )
155             {
156                 i_type2 = TYPE_HTML;
157             }
158             else if( !strncasecmp( p_peek, "<asx", sizeof("<asx") -1 ) )
159             {
160                 i_type2 = TYPE_ASX;
161             }
162 #if 0
163             else if( !strncasecmp( p_peek, "<?xml", sizeof("<?xml") -1 ) )
164             {
165                 i_type2 = TYPE_B4S;
166             }
167 #endif
168         }
169     }
170     if( i_type == TYPE_UNKNOWN && i_type2 == TYPE_UNKNOWN)
171     {
172         return VLC_EGENERIC;
173     }
174     if( i_type  != TYPE_UNKNOWN && i_type2 == TYPE_UNKNOWN )
175     {
176         i_type = TYPE_M3U;
177     }
178     else
179     {
180         i_type = i_type2;
181     }
182
183     /* Allocate p_m3u */
184     p_demux->p_sys = malloc( sizeof( demux_sys_t ) );
185     p_demux->p_sys->i_type = i_type;
186
187     return VLC_SUCCESS;
188 }
189
190 /*****************************************************************************
191  * Deactivate: frees unused data
192  *****************************************************************************/
193 static void Deactivate( vlc_object_t *p_this )
194 {
195     demux_t *p_demux = (demux_t *)p_this;
196     free( p_demux->p_sys );
197 }
198
199 /*****************************************************************************
200  * XMLSpecialChars: Handle the special chars in a XML file.
201  * ***************************************************************************/
202 static void XMLSpecialChars ( char *str )
203 {
204     char *src = str;
205     char *dst = str;
206
207     while( *src )
208     {
209         if( *src == '&' )
210         {
211             if( !strncasecmp( src, "&#xe0;", 6 ) ) *dst++ = 'à';
212             else if( !strncasecmp( src, "&#xee;", 6 ) ) *dst++ = 'î';
213             else if( !strncasecmp( src, "&apos;", 6 ) ) *dst++ = '\'';
214             else if( !strncasecmp( src, "&#xe8;", 6 ) ) *dst++ = 'è';
215             else if( !strncasecmp( src, "&#xe9;", 6 ) ) *dst++ = 'é';
216             else if( !strncasecmp( src, "&#xea;", 6 ) ) *dst++ = 'ê';
217             else
218             {
219                 *dst++ = '?';
220             }
221             src += 6;
222         }
223         else
224         {
225             *dst++ = *src++;
226         }
227     }
228
229     *dst = '\0';
230 }
231
232 /*****************************************************************************
233  * ParseLine: read a "line" from the file and add any entries found
234  * to the playlist. Returns:
235  * 0 if nothing was found
236  * 1 if a URI was found (it is then copied in psz_data)
237  * 2 if a name was found (  "  )
238  *
239  * XXX psz_data has the same length that psz_line so no problem if you don't
240  * expand it
241  *    psz_line is \0 terminated
242  *****************************************************************************/
243 static int ParseLine( demux_t *p_demux, char *psz_line, char *psz_data,
244                       vlc_bool_t *pb_next )
245 {
246     demux_sys_t *p_m3u = p_demux->p_sys;
247     char        *psz_bol, *psz_name;
248
249     psz_bol = psz_line;
250
251     *pb_next = VLC_FALSE;
252
253     /* Remove unnecessary tabs or spaces at the beginning of line */
254     while( *psz_bol == ' ' || *psz_bol == '\t' ||
255            *psz_bol == '\n' || *psz_bol == '\r' )
256     {
257         psz_bol++;
258     }
259
260     if( p_m3u->i_type == TYPE_M3U )
261     {
262         /* Check for comment line */
263         if( *psz_bol == '#' )
264         {
265             while( *psz_bol &&
266                    strncasecmp( psz_bol, "EXTINF:",
267                                 sizeof("EXTINF:") - 1 ) &&
268                    strncasecmp( psz_bol, "EXTVLCOPT:",
269                                 sizeof("EXTVLCOPT:") - 1 ) ) psz_bol++;
270
271             if( !*psz_bol ) return 0;
272
273             if( !strncasecmp( psz_bol, "EXTINF:", sizeof("EXTINF:") - 1 ) )
274             {
275                 psz_bol = strchr( psz_bol, ',' );
276                 if ( !psz_bol ) return 0;
277                 psz_bol++;
278
279                 /* From now, we have a name line */
280                 strcpy( psz_data , psz_bol );
281                 return 2;
282             }
283             else
284             {
285                 psz_bol = strchr( psz_bol, ':' );
286                 if ( !psz_bol ) return 0;
287                 psz_bol++;
288
289                 strcpy( psz_data , psz_bol );
290                 return 3;
291             }
292         }
293         /* If we don't have a comment, the line is directly the URI */
294     }
295     else if ( p_m3u->i_type == TYPE_PLS )
296     {
297         /* We are dealing with .pls files from shoutcast
298          * We are looking for lines like "File1=http://..." */
299         if( !strncasecmp( psz_bol, "File", sizeof("File") - 1 ) )
300         {
301             psz_bol += sizeof("File") - 1;
302             psz_bol = strchr( psz_bol, '=' );
303             if ( !psz_bol ) return 0;
304             psz_bol++;
305         }
306         else
307         {
308             return 0;
309         }
310     }
311     else if ( p_m3u->i_type == TYPE_WMP )
312     {
313         /* We are dealing with some weird WMP stream playlist format
314          * Hurray for idiotic M$. Lines look like: "Ref1=http://..." */
315         if( !strncasecmp( psz_bol, "Ref", sizeof("Ref") - 1 ) )
316         {
317             psz_bol += sizeof("Ref") - 1;
318             psz_bol = strchr( psz_bol, '=' );
319             if ( !psz_bol ) return 0;
320             psz_bol++;
321             if( !strncasecmp( psz_bol, "http://", sizeof("http://") -1 ) )
322             {
323                 psz_bol[0] = 'm'; psz_bol[1] = 'm'; psz_bol[2] = 's'; psz_bol[3] = 'h';
324             }
325         }
326         else
327         {
328             return 0;
329         }
330     }
331     else if ( p_m3u->i_type == TYPE_ASX )
332     {
333         /* We are dealing with ASX files.
334          * We are looking for "<ref href=" xml markups that
335          * begins with "mms://", "http://" or "file://" */
336         char *psz_eol;
337
338         while( *psz_bol &&
339                strncasecmp( psz_bol, "ref", sizeof("ref") - 1 ) )
340             psz_bol++;
341
342         if( !*psz_bol ) return 0;
343
344         while( *psz_bol &&
345                strncasecmp( psz_bol, "href", sizeof("href") - 1 ) )
346             psz_bol++;
347
348         if( !*psz_bol ) return 0;
349
350         while( *psz_bol &&
351                strncasecmp( psz_bol, "mms://",
352                             sizeof("mms://") - 1 ) &&
353                strncasecmp( psz_bol, "mmsu://",
354                             sizeof("mmsu://") - 1 ) &&
355                strncasecmp( psz_bol, "mmst://",
356                             sizeof("mmst://") - 1 ) &&
357                strncasecmp( psz_bol, "http://",
358                             sizeof("http://") - 1 ) &&
359                strncasecmp( psz_bol, "file://",
360                             sizeof("file://") - 1 ) )
361             psz_bol++;
362
363         if( !*psz_bol ) return 0;
364
365         psz_eol = strchr( psz_bol, '"');
366         if( !psz_eol )
367           return 0;
368
369         *psz_eol = '\0';
370     }
371     else if ( p_m3u->i_type == TYPE_HTML )
372     {
373         /* We are dealing with a html file with embedded
374          * video.  We are looking for "<param name="filename"
375          * value=" html markups that begin with "http://" */
376         char *psz_eol;
377
378         while( *psz_bol &&
379                strncasecmp( psz_bol, "param", sizeof("param") - 1 ) )
380             psz_bol++;
381
382         if( !*psz_bol ) return 0;
383
384         while( *psz_bol &&
385                strncasecmp( psz_bol, "filename", sizeof("filename") - 1 ) )
386             psz_bol++;
387
388         if( !*psz_bol ) return 0;
389
390         while( *psz_bol &&
391                strncasecmp( psz_bol, "http://",
392                             sizeof("http://") - 1 ) )
393             psz_bol++;
394
395         if( !*psz_bol ) return 0;
396
397         psz_eol = strchr( psz_bol, '"');
398         if( !psz_eol )
399           return 0;
400
401         *psz_eol = '\0';
402
403     }
404     else if ( p_m3u->i_type == TYPE_B4S )
405     {
406
407         char *psz_eol;
408
409         msg_Dbg( p_demux, "b4s line=%s", psz_line );
410         /* We are dealing with a B4S file from Winamp 3 */
411
412         /* First, search for name *
413          * <Name>Blabla</Name> */
414
415         if( strstr ( psz_bol, "<Name>" ) )
416         {
417             /* We have a name */
418             while ( *psz_bol &&
419                     strncasecmp( psz_bol,"Name",sizeof("Name") -1 ) )
420                 psz_bol++;
421
422             if( !*psz_bol ) return 0;
423
424             psz_bol = psz_bol + 5 ;
425             /* We are now at the beginning of the name */
426
427             if( !psz_bol ) return 0;
428
429
430             psz_eol = strchr(psz_bol, '<' );
431             if( !psz_eol) return 0;
432
433             *psz_eol='\0';
434
435             XMLSpecialChars( psz_bol );
436
437             strcpy( psz_data, psz_bol );
438             return 2;
439         }
440         else if( strstr( psz_bol, "</entry>" ) || strstr( psz_bol, "</Entry>" ))
441         {
442             *pb_next = VLC_TRUE;
443             return 0;
444         }
445
446          /* We are looking for <entry Playstring="blabla"> */
447
448
449         while ( *psz_bol &&
450                 strncasecmp( psz_bol,"Playstring",sizeof("Playstring") -1 ) )
451             psz_bol++;
452
453         if( !*psz_bol ) return 0;
454
455         psz_bol = strchr( psz_bol, '=' );
456         if ( !psz_bol ) return 0;
457
458         psz_bol += 2;
459
460         psz_eol= strchr(psz_bol, '"');
461         if( !psz_eol ) return 0;
462
463         *psz_eol= '\0';
464
465         /* Handle the XML special characters */
466         XMLSpecialChars( psz_bol );
467     }
468     else
469     {
470         msg_Warn( p_demux, "unknown file type" );
471         return 0;
472     }
473
474     /* empty line */
475     if ( !*psz_bol ) return 0;
476
477     /*
478      * From now on, we know we've got a meaningful line
479      */
480
481     /* check for a protocol name */
482     /* for URL, we should look for "://"
483      * for MRL (Media Resource Locator) ([[<access>][/<demux>]:][<source>]),
484      * we should look for ":"
485      * so we end up looking simply for ":"*/
486     /* PB: on some file systems, ':' are valid characters though*/
487     psz_name = psz_bol;
488     while( *psz_name && *psz_name!=':' )
489     {
490         psz_name++;
491     }
492 #ifdef WIN32
493     if ( *psz_name && ( psz_name == psz_bol + 1 ) )
494     {
495         /* if it is not an URL,
496          * as it is unlikely to be an MRL (PB: if it is ?)
497          * it should be an absolute file name with the drive letter */
498         if ( *(psz_name+1) == '/' )/* "*:/" */
499         {
500             if ( *(psz_name+2) != '/' )/* not "*://" */
501                 while ( *psz_name ) *psz_name++;/* so now (*psz_name==0) */
502         }
503         else while ( *psz_name ) *psz_name++;/* "*:*"*/
504     }
505 #endif
506
507     /* if the line doesn't specify a protocol name,
508      * check if the line has an absolute or relative path */
509 #ifndef WIN32
510     if( !*psz_name && *psz_bol != '/' )
511          /* If this line doesn't begin with a '/' */
512 #else
513     if( !*psz_name
514             && *psz_bol!='/'
515             && *psz_bol!='\\'
516             && *(psz_bol+1)!=':' )
517          /* if this line doesn't begin with
518           *  "/" or "\" or "*:" or "*:\" or "*:/" or "\\" */
519 #endif
520     {
521         /* assume the path is relative to the path of the m3u file. */
522         char *psz_path = strdup( p_demux->psz_path );
523
524 #ifndef WIN32
525         psz_name = strrchr( psz_path, '/' );
526 #else
527         psz_name = strrchr( psz_path, '\\' );
528         if ( ! psz_name ) psz_name = strrchr( psz_path, '/' );
529 #endif
530         if( psz_name ) *psz_name = '\0';
531         else *psz_path = '\0';
532 #ifndef WIN32
533         psz_name = malloc( strlen(psz_path) + strlen(psz_bol) + 2 );
534         sprintf( psz_name, "%s/%s", psz_path, psz_bol );
535 #else
536         if ( *psz_path != '\0' )
537         {
538             psz_name = malloc( strlen(psz_path) + strlen(psz_bol) + 2 );
539             sprintf( psz_name, "%s\\%s", psz_path, psz_bol );
540         }
541         else psz_name = strdup( psz_bol );
542 #endif
543         free( psz_path );
544     }
545     else
546     {
547         psz_name = strdup( psz_bol );
548     }
549
550     strcpy(psz_data, psz_name ) ;
551
552     free( psz_name );
553
554     if( p_m3u->i_type != TYPE_B4S )
555     {
556        *pb_next = VLC_TRUE;
557     }
558
559     return 1;
560 }
561
562 static void ProcessLine ( demux_t *p_demux, playlist_t *p_playlist,
563                           char *psz_line, char **ppsz_uri, char **ppsz_name,
564                           int *pi_options, char ***pppsz_options,
565                           int *pi_position )
566 {
567     char          psz_data[MAX_LINE];
568     vlc_bool_t    b_next;
569
570     switch( ParseLine( p_demux, psz_line, psz_data, &b_next ) )
571     {
572         case 1:
573             if( *ppsz_uri )
574             {
575                 free( *ppsz_uri );
576             }
577             *ppsz_uri = strdup( psz_data );
578             break;
579         case 2:
580             if( *ppsz_name )
581             {
582                 free( *ppsz_name );
583             }
584             *ppsz_name = strdup( psz_data );
585             break;
586         case 3:
587             (*pi_options)++;
588             *pppsz_options = realloc( *pppsz_options,
589                                       sizeof(char *) * *pi_options );
590             (*pppsz_options)[*pi_options - 1] = strdup( psz_data );
591             break;
592         case 0:
593         default:
594             break;
595     }
596
597     if( b_next && *ppsz_uri )
598     {
599         playlist_AddExt( p_playlist, *ppsz_uri, *ppsz_name,
600                          PLAYLIST_INSERT, *pi_position,
601                          -1, (const char **)*pppsz_options, *pi_options );
602
603         (*pi_position)++;
604         if( *ppsz_name ) free( *ppsz_name ); *ppsz_name = NULL;
605         free( *ppsz_uri ); *ppsz_uri  = NULL;
606
607         for( ; *pi_options; (*pi_options)-- )
608         {
609             free( (*pppsz_options)[*pi_options - 1] );
610             if( *pi_options == 1 ) free( *pppsz_options );
611         }
612         *pppsz_options = NULL;
613     }
614 }
615
616 /*****************************************************************************
617  * Demux: reads and demuxes data packets
618  *****************************************************************************
619  * Returns -1 in case of error, 0 in case of EOF, 1 otherwise
620  *****************************************************************************/
621 static int Demux( demux_t *p_demux )
622 {
623     demux_sys_t   *p_m3u = p_demux->p_sys;
624
625     char          psz_line[MAX_LINE];
626     char          p_buf[MAX_LINE], eol_tok;
627     int           i_size, i_bufpos, i_linepos = 0;
628     playlist_t    *p_playlist;
629     vlc_bool_t    b_discard = VLC_FALSE;
630
631     char          *psz_name = NULL;
632     char          *psz_uri  = NULL;
633     int           i_options = 0;
634     char          **ppsz_options = NULL;
635
636     int           i_position;
637
638     p_playlist = (playlist_t *) vlc_object_find( p_demux, VLC_OBJECT_PLAYLIST,
639                                                  FIND_ANYWHERE );
640     if( !p_playlist )
641     {
642         msg_Err( p_demux, "can't find playlist" );
643         return -1;
644     }
645
646     p_playlist->pp_items[p_playlist->i_index]->b_autodeletion = VLC_TRUE;
647     i_position = p_playlist->i_index + 1;
648
649     /* Depending on wether we are dealing with an m3u/asf file, the end of
650      * line token will be different */
651     if( p_m3u->i_type == TYPE_ASX || p_m3u->i_type == TYPE_HTML )
652         eol_tok = '>';
653     else
654         eol_tok = '\n';
655
656     while( ( i_size = stream_Read( p_demux->s, p_buf, MAX_LINE ) ) )
657     {
658         i_bufpos = 0;
659
660         while( i_size )
661         {
662             /* Build a line < MAX_LINE */
663             while( p_buf[i_bufpos] != eol_tok && i_size )
664             {
665                 if( i_linepos == MAX_LINE || b_discard == VLC_TRUE )
666                 {
667                     /* line is bigger than MAX_LINE, discard it */
668                     i_linepos = 0;
669                     b_discard = VLC_TRUE;
670                 }
671                 else
672                 {
673                     if ( eol_tok != '\n' || p_buf[i_bufpos] != '\r' )
674                     {
675                         psz_line[i_linepos] = p_buf[i_bufpos];
676                         i_linepos++;
677                     }
678                 }
679
680                 i_size--; i_bufpos++;
681             }
682
683             /* Check if we need more data */
684             if( !i_size ) continue;
685
686             i_size--; i_bufpos++;
687             b_discard = VLC_FALSE;
688
689             /* Check for empty line */
690             if( !i_linepos ) continue;
691
692             psz_line[i_linepos] = '\0';
693             i_linepos = 0;
694
695             ProcessLine( p_demux, p_playlist, psz_line, &psz_uri, &psz_name,
696                          &i_options, &ppsz_options, &i_position );
697         }
698     }
699
700     if ( i_linepos && b_discard != VLC_TRUE && eol_tok == '\n' )
701     {
702         psz_line[i_linepos] = '\0';
703
704         ProcessLine( p_demux, p_playlist, psz_line, &psz_uri, &psz_name,
705                      &i_options, &ppsz_options, &i_position );
706
707         /* Is there a pendding uri without b_next */
708         if( psz_uri )
709         {
710             playlist_AddExt( p_playlist, psz_uri, psz_name,
711                              PLAYLIST_INSERT, i_position,
712                              -1, (const char **)ppsz_options, i_options );
713         }
714     }
715
716     if( psz_uri ) free( psz_uri );
717     if( psz_name ) free( psz_name );
718     for( ; i_options; i_options-- )
719     {
720         free( ppsz_options[i_options - 1] );
721         if( i_options == 1 ) free( ppsz_options );
722     }
723
724     vlc_object_release( p_playlist );
725
726     return 0;
727 }
728
729 static int Control( demux_t *p_demux, int i_query, va_list args )
730 {
731     return VLC_EGENERIC;
732 }