<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>How to fix loading videos from zip that is in a path?</title>
		<link>http://www.allegro.cc/forums/view/618049</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 03 Mar 2020 09:57:49 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>This still does not seem to be working. If the videos are located in the root of the archive, they will load and play just fine. However if they are located in a path such as this: &quot;videos/myvideo.ogv&quot;, it will fail to load. I have all the resources organized in folders inside the archive. All other resources seem to not suffer from this problem. How/where can this be fixed?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (tinyBigGAMES)</author>
		<pubDate>Mon, 02 Mar 2020 09:33:10 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Show code and provide a minimal example that demonstrates this please. Please also update to latest allegro and physfs and zlib before testing.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 02 Mar 2020 09:49:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>procedure test03<span class="k2">;</span>
<span class="number">  2</span>var
<span class="number">  3</span>  display: PALLEGRO_DISPLAY<span class="k2">;</span>
<span class="number">  4</span>  video: PALLEGRO_VIDEO<span class="k2">;</span>
<span class="number">  5</span>begin
<span class="number">  6</span>  <a href="http://www.allegro.cc/manual/al_init"><span class="a">al_init</span></a><span class="k2">;</span>
<span class="number">  7</span>  al_init_video_addon<span class="k2">;</span>
<span class="number">  8</span>
<span class="number">  9</span>  PHYSFS_init<span class="k2">(</span>nil<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 10</span>  PHYSFS_mount<span class="k2">(</span><span class="s">'archive.zip'</span>, <span class="s">''</span>, <span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 11</span>
<span class="number"> 12</span>  display <span class="k2">:</span><span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_create_display"><span class="a">al_create_display</span></a><span class="k2">(</span><span class="n">480</span>, <span class="n">600</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 13</span>  <a href="http://www.allegro.cc/manual/al_set_window_title"><span class="a">al_set_window_title</span></a><span class="k2">(</span>display, <span class="s">'video test'</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 14</span>  <a href="http://www.allegro.cc/manual/al_clear_to_color"><span class="a">al_clear_to_color</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_map_rgba"><span class="a">al_map_rgba</span></a><span class="k2">(</span><span class="n">32</span>,<span class="n">32</span>,<span class="n">32</span>,<span class="n">255</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 15</span>
<span class="number"> 16</span>  <a href="http://www.allegro.cc/manual/al_set_physfs_file_interface"><span class="a">al_set_physfs_file_interface</span></a><span class="k2">;</span>
<span class="number"> 17</span>
<span class="number"> 18</span>  <span class="c">// if video is in root of archive, works</span>
<span class="number"> 19</span>  video <span class="k2">:</span><span class="k3">=</span> al_open_video<span class="k2">(</span><span class="s">'presents.ogv'</span><span class="k2">)</span><span class="k2">;</span> 
<span class="number"> 20</span>  
<span class="number"> 21</span>  <span class="c">// if video is off a path, fails</span>
<span class="number"> 22</span>  video <span class="k2">:</span><span class="k3">=</span> al_open_video<span class="k2">(</span><span class="s">'arc/videos/presents.ogv'</span><span class="k2">)</span><span class="k2">;</span> 
<span class="number"> 23</span>
<span class="number"> 24</span>  al_close_video<span class="k2">(</span>video<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 25</span>  <a href="http://www.allegro.cc/manual/al_destroy_display"><span class="a">al_destroy_display</span></a><span class="k2">(</span>display<span class="k2">)</span><span class="k2">;</span>
<span class="number"> 26</span>
<span class="number"> 27</span>  PHYSFS_deinit<span class="k2">;</span>
<span class="number"> 28</span>
<span class="number"> 29</span>end<span class="k2">;</span>
</div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (tinyBigGAMES)</author>
		<pubDate>Mon, 02 Mar 2020 10:00:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>And, what versions of allegro, physfs, and zlib are you using?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Mon, 02 Mar 2020 10:23:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The latest build of Allegro, 5.2.6.0. What ever versions that are inside that DLL. I&#39;m using Delphi. For the record, this did not work with the prev version of Allegro either.</p><p>I&#39;m using the monolith dll from:</p><p>allegro-i686-w64-mingw32-gcc-9.2.0-posix-dwarf-static-5.2.6.0.zip
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (tinyBigGAMES)</author>
		<pubDate>Mon, 02 Mar 2020 10:54:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I tried it on Linux, and it seemed to work okay. I did:</p><div class="source-code snippet"><div class="inner"><pre>PHYSFS_init<span class="k2">(</span>argv<span class="k2">[</span><span class="n">0</span><span class="k2">]</span><span class="k2">)</span><span class="k2">;</span>
PHYSFS_mount<span class="k2">(</span><span class="s">"/home/siege/src/A5/video_zip.zip"</span>, NULL, <span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_set_physfs_file_interface"><span class="a">al_set_physfs_file_interface</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
al_open_video<span class="k2">(</span><span class="s">"video/test.ogv"</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

I&#39;ll try the Windows binaries tomorrow, maybe the packages are broken somehow.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Mon, 02 Mar 2020 13:18:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>could it be this line in ogv.c:<br />filename = al_path_cstr(video-&gt;filename, ALLEGRO_NATIVE_PATH_SEP);</p><p>looking around the src, I see this:<br />helper = al_path_cstr(path, &#39;/&#39;);</p><p>Then I found this:<br /><a href="https://www.allegro.cc/forums/thread/617884">https://www.allegro.cc/forums/thread/617884</a></p><p>Could all it be is need to remove ALLEGRO_NATIVE_PATH_SEP?</p><p>I don&#39;t currently have things setup to build allegro to test this. Last time I tried, phew, it was a task.</p><p>UPDATE:<br />I can confirm that ALLEGRO_NATIVE_PATH_SEP + PHYSFS on Windows is an issue. I changed it to &#39;/&#39; and it works as expected now. (Spent about 3 hrs trying to get Allegro to compile on Windows, sigh)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (tinyBigGAMES)</author>
		<pubDate>Mon, 02 Mar 2020 22:46:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Nice, that&#39;s exactly the issue, thanks for investigating. Sorry for your troubles compiling!</p><p>I could reproduce this on Windows, but we&#39;ll do a different fix since this is a wider problem: <a href="https://github.com/liballeg/allegro5/pull/1118">https://github.com/liballeg/allegro5/pull/1118</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (SiegeLord)</author>
		<pubDate>Tue, 03 Mar 2020 09:32:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>NICE! Thanks for the fix. I&#39;ve pulled it down, recompiled and can confirm all works as expected. Thanks again, to all that helped with this.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (tinyBigGAMES)</author>
		<pubDate>Tue, 03 Mar 2020 09:57:49 +0000</pubDate>
	</item>
</rss>
