diff --git a/addons/video/video.c b/addons/video/video.c index 34c9eae897..fc1957dd38 100644 --- a/addons/video/video.c +++ b/addons/video/video.c @@ -1,43 +1,43 @@ /* This is just a quick hack. But good enough for our use of displaying * a short intro video when our game starts up - so might as well share * it. - * + * * Known bugs: - * + * * - Only very crude synching. Audio is slightly delayed and some * videos seem to constantly drift off and then the audio gets all * distorted... * * - Seeking/Pausing doesn't really work. - * + * * - Memory leaks. Easy to fix but don't have time right now. * * Missing features: - * + * * - Stream information. For example allow selection of one of several * audio streams or subtitle overlay streams. - * + * * - Non audio/video streams. For example something like: * ALLEGRO_USTR *al_get_video_subtitle(float *x, float *y); - * + * * - Buffering. Right now buffering is hardcoded to a fixed size which * seemed enough for streaming 720p from disk in my tests. Obviously * when streaming higher bandwidth or from a source with high * fluctuation like an internet stream this won't work at all. - * + * * - Provide an audio stream for the audio. Then could use this to * stream audio files. Right now opening an .mp3 with the video * addon will play it but only with the video API instead of Allegro's * normal audio streaming API... - * + * * - Audio/Video sync. For a game user-controlled sync is probably not * too important as it can just ship with a properly synchronizeded * video. However right now the audio delay is completely ignored. - * + * * - Additional drivers. Also redo the API a bit so not everything * has to be done by the driver. */ - + #include "allegro5/allegro5.h" #include "allegro5/allegro_video.h" #include "allegro5/internal/aintern.h" @@ -119,7 +119,6 @@ ALLEGRO_VIDEO *al_open_video(char const *filename) } video->filename = al_create_path(filename); - video->playing = true; if (!video->vtable->open_video(video)) { ALLEGRO_ERROR("Could not open %s.\n", filename); @@ -127,10 +126,10 @@ ALLEGRO_VIDEO *al_open_video(char const *filename) al_free(video); return NULL; } - + al_init_user_event_source(&video->es); video->es_inited = true; - + return video; } @@ -164,6 +163,7 @@ void al_start_video(ALLEGRO_VIDEO *video, ALLEGRO_MIXER *mixer) /* XXX why is this not just a parameter? */ video->mixer = mixer; + video->playing = true; video->vtable->start_video(video); } diff --git a/docs/src/refman/video.txt b/docs/src/refman/video.txt index e2bd61a246..f9e60a3804 100644 --- a/docs/src/refman/video.txt +++ b/docs/src/refman/video.txt @@ -87,7 +87,7 @@ Since: 5.1.12 ## API: al_open_video -Reads a video file. This does not start streaming yet but reads the +Reads a video file. This does not start playing yet but reads the meta info so you can query e.g. the size or audio rate. Since: 5.1.0 @@ -127,7 +127,7 @@ Since: 5.1.0 ## API: al_start_video -Starts streaming the video from the beginning. +Starts playing the video from the beginning. Since: 5.1.0