Hi people!
I have this project (called LAS), to help new students in my university, this isn´t a game, you can think it like an Encarta (an interactive book), and I want this program could plays videos, some videos I will make with Blender, so.... my problem is this: I can´t play videos after init physfs
I mean:
project only with physfs works fine
project only with video addon works fine
project doesnt works fine, can't play video if physfs is used before, but can play video before use physfs (open video cant find video, give me NULL)
So, I thought the problem could be the interface I/O, so I tried to fixed using:
void al_set_fs_interface()
void al_set_standard_fs_interface()
void al_restore_state()
void al_set_standard_file_interface()
...to manage the interfaces
in some strategic places of the program, but I don´t know the how to
please help me 
void al_set_fs_interface(const ALLEGRO_FS_INTERFACE *fs_interface); { thread_local_state *tls; if ((tls = tls_get()) == NULL) return; tls->fs_interface = fs_interface; } void al_set_standard_fs_interface(void) { al_set_fs_interface(&_al_fs_interface_stdio); } int main(void)
What exactly are you trying to do here? You can't just re-write and override functions like that :O xD
Please try reading the manual.
http://liballeg.org/a5docs/trunk/physfs.html#al_set_physfs_file_interface
http://liballeg.org/a5docs/trunk/fshook.html#al_set_standard_fs_interface
After you call physfs_init, call al_set_physfs_file_interface. Now load all of your assets from the zip archive you specified. After that when you're all done with your data file, call al_set_standard_fs_interface to use the normal filesystem interface for your video streaming.
Hi Edgar!
I just copied that from someplace, and copy & paste
I already read that pages before, but I dont understand what they say, it is obscure thing to me yet
like magic....
Thanks for answer and I will try that solution
Copy Paste Coding is the Source of All EvilTM...
There are a lot of other things that need to be fixed in your code as well.
Your code needs to be formatted with proper indentation spacing, or no one will bother reading it, as it is too confusing.
You're using function declarations where you're trying to call a function, you're playing the video with rest in addition to a timer, and I'm sure there are other things.
In my Deluxe Pacman 2 game (below), I initialize Physfs with the following code:
/// ****** Initialize PHYSFS ******* PHYSFS_init(NULL); if(!PHYSFS_mount("Deluxe Pacman 2.pak", "/", 1)) { a5_error(AT, setting.screen, "PHSYFS_init() failed."); exit(1); } al_set_physfs_file_interface();
Note: the a5_error() is my own personal function, not part of Allegro 5.
In the above case, my "Deluxe Pacman 2.pak" file is just a ZIP file renamed and all file access will look inside of it when al_set_physfs_file_interface(); is invoked.
For normal file access you would use al_set_standard_file_interface();, check for files outside of your ZIP and then invoke al_set_physfs_file_interface(); again to switch back to the ZIP. Which is what I do in my game.
My mistake. I confused fs_interface with file_interface. Neil is right, use al_set_physfs_file_interface and al_set_standard_file_interface, not fs interface. For some bizarre reason they're separate.
Solved problem!
but when I tried to clean the video fragment I have problems, maybe because I followed this post https://www.allegro.cc/forums/thread/612410
BUT, in that example, there is'nt a timer, so my video flickr and restart infinite times halting my pc
console says: null null null null
Edgar's solution is a good one. No misused timer as he uses events (more garanties to have it running at the same fps everywhere), and it manages redraw.
I put together a working example for you AramisL, here it is :
Video.zip (win32 binary + src)
Here's the full code :
I think the only thing you are missing is to register the video event source with your event queue. That's why you're not getting any events.
al_register_event_source(queue , al_get_video_event_source(video));
Then you'll want to monitor ALLEGRO_EVENT_VIDEO_FRAME_SHOW and ALLEGRO_EVENT_VIDEO_FINISHED event types in your event loop.