How to fix loading videos from zip that is in a path?
tinyBigGAMES

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: "videos/myvideo.ogv", 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?

Edgar Reynaldo

Show code and provide a minimal example that demonstrates this please. Please also update to latest allegro and physfs and zlib before testing.

tinyBigGAMES

#SelectExpand
1procedure test03; 2var 3 display: PALLEGRO_DISPLAY; 4 video: PALLEGRO_VIDEO; 5begin 6 al_init; 7 al_init_video_addon; 8 9 PHYSFS_init(nil); 10 PHYSFS_mount('archive.zip', '', 1); 11 12 display := al_create_display(480, 600); 13 al_set_window_title(display, 'video test'); 14 al_clear_to_color(al_map_rgba(32,32,32,255)); 15 16 al_set_physfs_file_interface; 17 18 // if video is in root of archive, works 19 video := al_open_video('presents.ogv'); 20 21 // if video is off a path, fails 22 video := al_open_video('arc/videos/presents.ogv'); 23 24 al_close_video(video); 25 al_destroy_display(display); 26 27 PHYSFS_deinit; 28 29end;

Edgar Reynaldo

And, what versions of allegro, physfs, and zlib are you using?

tinyBigGAMES

The latest build of Allegro, 5.2.6.0. What ever versions that are inside that DLL. I'm using Delphi. For the record, this did not work with the prev version of Allegro either.

I'm using the monolith dll from:

allegro-i686-w64-mingw32-gcc-9.2.0-posix-dwarf-static-5.2.6.0.zip

SiegeLord

I tried it on Linux, and it seemed to work okay. I did:

PHYSFS_init(argv[0]);
PHYSFS_mount("/home/siege/src/A5/video_zip.zip", NULL, 1);
al_set_physfs_file_interface();
al_open_video("video/test.ogv");

I'll try the Windows binaries tomorrow, maybe the packages are broken somehow.

tinyBigGAMES

could it be this line in ogv.c:
filename = al_path_cstr(video->filename, ALLEGRO_NATIVE_PATH_SEP);

looking around the src, I see this:
helper = al_path_cstr(path, '/');

Then I found this:
https://www.allegro.cc/forums/thread/617884

Could all it be is need to remove ALLEGRO_NATIVE_PATH_SEP?

I don't currently have things setup to build allegro to test this. Last time I tried, phew, it was a task.

UPDATE:
I can confirm that ALLEGRO_NATIVE_PATH_SEP + PHYSFS on Windows is an issue. I changed it to '/' and it works as expected now. (Spent about 3 hrs trying to get Allegro to compile on Windows, sigh)

SiegeLord

Nice, that's exactly the issue, thanks for investigating. Sorry for your troubles compiling!

I could reproduce this on Windows, but we'll do a different fix since this is a wider problem: https://github.com/liballeg/allegro5/pull/1118

tinyBigGAMES

NICE! Thanks for the fix. I've pulled it down, recompiled and can confirm all works as expected. Thanks again, to all that helped with this.

Thread #618049. Printed from Allegro.cc