{"duration", SIMPLE_CONTENT, {.smpl = set_item_info} },
{"link", SIMPLE_CONTENT, {NULL} },
{"meta", SIMPLE_CONTENT, {NULL} },
- {"extension", COMPLEX_CONTENT, {.cmplx = skip_element} },
+ {"extension", COMPLEX_CONTENT, {.cmplx = parse_extension_node} },
{NULL, UNKNOWN_CONTENT, {NULL} }
};
return true;
}
+/**
+ * \brief handles the <option> elements
+ */
+static bool set_option SIMPLE_INTERFACE
+{
+ /* exit if setting is impossible */
+ if( !psz_name || !psz_value || !p_input )
+ return false;
+
+ /* re-convert xml special characters inside psz_value */
+ resolve_xml_special_chars( psz_value );
+
+ input_ItemAddOpt( p_input, psz_value, 0 );
+
+ return true;
+}
/**
* \brief parse the extension node of a XSPF playlist
xml_elem_hnd_t pl_elements[] =
{ {"node", COMPLEX_CONTENT, {.cmplx = parse_extension_node} },
{"item", COMPLEX_CONTENT, {.cmplx = parse_extitem_node} },
+ {"option", SIMPLE_CONTENT, {.smpl = set_option} },
{NULL, UNKNOWN_CONTENT, {NULL} }
};
{
char *psz;
char *psz_temp;
+ int i;
mtime_t i_duration;
if( !p_item ) return;
}
free( psz );
+ /* export the input's options (bookmarks, ...) in <extension> */
+ fprintf( p_file, "\t\t\t<extension application=\"http://www.videolan.org/vlc/playlist/0\">\n" );
+ for( i = 0; i < p_item->p_input->i_options; i++ )
+ {
+ fprintf( p_file, "\t\t\t\t<option>%s</option>\n",
+ p_item->p_input->ppsz_options[i][0] == ':' ?
+ p_item->p_input->ppsz_options[i] + 1 :
+ p_item->p_input->ppsz_options[i] );
+ }
+ fprintf( p_file, "\t\t\t</extension>\n" );
+
xspfexportitem_end:
/* -> the duration */
i_duration = input_item_GetDuration( p_item->p_input );