<div dir="ltr">Wayne,<div><br></div><div>The cardinality of the location element is "zero or more." This was chosen instead of "zero or one" with the intention of supporting both of the use cases you mention (fallbacks and alternate media types).</div><div><br></div><div>What VLC and Audacious do in only using the last location is an incorrect implementation.</div><div><br></div><div>That said, our strategy was to make it easy to build a weak resolver, and possible to build a strong one. If VLC or Audacious become stronger over time by adding support for redundant locations, that is the process playing out as hoped.</div><div><br></div><div>I wonder what we can do to help this happen in the VLC and Audacious communities.</div><div><br></div><div>-Lucas</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 12, 2016 at 12:45 PM, Wayne DePrince Jr. <span dir="ltr"><<a href="mailto:waynedpj@in-giro.xyz" target="_blank">waynedpj@in-giro.xyz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-family:Monospace"><div>ahoy all,</div><div><br></div><div><span class="m_7137183141319111752Apple-tab-span" style="white-space:pre-wrap"> </span>for parsing an [XSPF][1] document, the [specification][2] states that [a `<track>` element can have zero or more `<location>` elements to define the URI of a resource to be rendered][3]. for example:</div><div><br></div><div><?xml version="1.0" encoding="UTF-8"?></div><div><playlist version="1" xmlns="<a href="http://xspf.org/ns/0/" target="_blank">http://xspf.org/ns/0/</a>"></div><div> <trackList></div><div> <track></div><div> <location><a href="http://example.com/song_1.ogg" target="_blank">http://example.com/<wbr>song_1.ogg</a></location></div><div> <location><a href="http://mirror.xyz/example.com/song_1.ogg" target="_blank">http://mirror.xyz/<wbr>example.com/song_1.ogg</a></<wbr>location></div><div> </track></div><div> <track</div><div> <location><a href="http://example.com/song_2.ogg" target="_blank">http://example.com/<wbr>song_2.ogg</a></location></div><div> <location><a href="http://example.com/song_2.mp3" target="_blank">http://example.com/<wbr>song_2.mp3</a></location></div><div> </track></div><div> </trackList></div><div></playlist></div><div><br></div><div>my question is whether this is for allowing:</div><div><br></div><div>- multiple locations of the same type of resource (e.g. MP3 file at original source and mirror) as in song_1 above?</div><div><br></div><div>- or for different types of the resource (e.g. use multiple locations to provide both an Ogg Vorbis and MP3 version of a track) as in song_2 above?</div><div><br></div><div>- or maybe both? and/or others?</div><div><br></div><div>currently VLC and Audacious both use the last `<location>` provided in a `<track>`, even if it is not available. thus they seem to simply be using only the last `<location>` element, which does not seem to be what the specification intends. either way they do not perform either of the resolve cases i list above.</div><div><br></div><div>obviously how these locations are interpreted changes the expected behavior of a resolver of `<track>` elements that include `<location>` elements. the first case provides a nice fallback solution. more interestingly for me, the second case simplifies the times when 2 playlists would be needed: 1 for Ogg Vorbis and 1 for MP3 versions of the tracks, as would have to be done with M3U and PLS for example.</div><div><br></div><div>thus: is there an standard or recommended behavior for handling/resolving multiple `<location>` elements for a single `<track>` in XSPF?</div><div><br></div><div>thanks</div><div><br></div><div> [1]: <a href="http://xspf.org" target="_blank">http://xspf.org</a></div><div> [2]: <a href="http://xspf.org/xspf-v1.html" target="_blank">http://xspf.org/xspf-v1.html</a></div><div> [3]: <a href="http://xspf.org/xspf-v1.html#rfc.section.4.1.1.2.14.1.1.1.1" target="_blank">http://xspf.org/xspf-v1.html#<wbr>rfc.section.4.1.1.2.14.1.1.1.1</a></div><div><br></div><div><br></div><div>PS: also posted to StackExchange</div><div><br></div><div><a href="https://stackoverflow.com/questions/41101769/multiple-location-elements-per-track-in-xspf" target="_blank">https://stackoverflow.com/<wbr>questions/41101769/multiple-<wbr>location-elements-per-track-<wbr>in-xspf</a></div><div><br></div><div><br></div><div class="m_7137183141319111752-x-evo-signature-wrapper"><span><pre>--
<a href="http://waynedpj.in-giro.xyz" target="_blank">http://waynedpj.in-giro.xyz</a></pre></span></div></div><br>______________________________<wbr>_________________<br>
Playlist mailing list<br>
<a href="mailto:Playlist@xiph.org">Playlist@xiph.org</a><br>
<a href="http://lists.xiph.org/mailman/listinfo/playlist" rel="noreferrer" target="_blank">http://lists.xiph.org/mailman/<wbr>listinfo/playlist</a><br>
<br></blockquote></div><br></div>