Changeset 0db5f2a07b883f92d95959221776423fcad85974

Show
Ignore:
Timestamp:
04/26/08 09:08:52 (4 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1209193732 +0300
git-parent:

[250db7be17a8decdeed5b7b6c73053fc31527d00]

git-author:
Antoine Lejeune <phytos@videolan.org> 1208974813 +0200
Message:

Ability to save and load input item options in xspf playlist as it is possible in m3u playlist.

Signed-off-by: Rémi Denis-Courmont <rem@videolan.org>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/playlist/xspf.c

    r449fd28 r0db5f2a  
    411411          {"link",         SIMPLE_CONTENT,  {NULL} }, 
    412412          {"meta",         SIMPLE_CONTENT,  {NULL} }, 
    413           {"extension",    COMPLEX_CONTENT, {.cmplx = skip_element} }, 
     413          {"extension",    COMPLEX_CONTENT, {.cmplx = parse_extension_node} }, 
    414414          {NULL,           UNKNOWN_CONTENT, {NULL} } 
    415415        }; 
     
    661661} 
    662662 
     663/** 
     664 * \brief handles the <option> elements 
     665 */ 
     666static bool set_option SIMPLE_INTERFACE 
     667{ 
     668    /* exit if setting is impossible */ 
     669    if( !psz_name || !psz_value || !p_input ) 
     670        return false; 
     671 
     672    /* re-convert xml special characters inside psz_value */ 
     673    resolve_xml_special_chars( psz_value ); 
     674     
     675    input_ItemAddOpt( p_input, psz_value, 0 ); 
     676     
     677    return true; 
     678} 
    663679 
    664680/** 
     
    678694        { {"node",  COMPLEX_CONTENT, {.cmplx = parse_extension_node} }, 
    679695          {"item",  COMPLEX_CONTENT, {.cmplx = parse_extitem_node} }, 
     696          {"option", SIMPLE_CONTENT, {.smpl = set_option} }, 
    680697          {NULL,    UNKNOWN_CONTENT, {NULL} } 
    681698        }; 
  • modules/demux/playlist/xspf.h

    r449fd28 r0db5f2a  
    4848static bool parse_extitem_node COMPLEX_INTERFACE; 
    4949static bool set_item_info SIMPLE_INTERFACE; 
     50static bool set_option SIMPLE_INTERFACE; 
    5051static bool skip_element COMPLEX_INTERFACE; 
    5152 
  • modules/misc/playlist/xspf.c

    r449fd28 r0db5f2a  
    116116    char *psz; 
    117117    char *psz_temp; 
     118    int i; 
    118119    mtime_t i_duration; 
    119120 
     
    225226    } 
    226227    free( psz ); 
     228 
     229    /* export the input's options (bookmarks, ...) in <extension> */ 
     230    fprintf( p_file, "\t\t\t<extension application=\"http://www.videolan.org/vlc/playlist/0\">\n" ); 
     231    for( i = 0; i < p_item->p_input->i_options; i++ ) 
     232    { 
     233        fprintf( p_file, "\t\t\t\t<option>%s</option>\n", 
     234                 p_item->p_input->ppsz_options[i][0] == ':' ? 
     235                 p_item->p_input->ppsz_options[i] + 1 : 
     236                 p_item->p_input->ppsz_options[i] ); 
     237    } 
     238    fprintf( p_file, "\t\t\t</extension>\n" ); 
    227239 
    228240xspfexportitem_end: